]> git.eshelyaron.com Git - emacs.git/log
emacs.git
6 years agoCall eglot-eldoc-function after completion finishes
João Távora [Wed, 9 May 2018 21:28:29 +0000 (22:28 +0100)]
Call eglot-eldoc-function after completion finishes

* eglot.el (eglot-completion-at-point): Call
eglot-eldoc-function after completion finishes.

6 years agoSimplify `eglot-shutdown`
João Távora [Wed, 9 May 2018 21:26:02 +0000 (22:26 +0100)]
Simplify `eglot-shutdown`

* eglot.el (eglot, eglot-reconnect)
(eglot--managed-mode): Call new eglot-shutdown.
(eglot-shutdown): Simplify.
(eglot--process-sentinel): Also call error functions.
(eglot--process-filter): Reindent.

6 years agoGet rid of eglot-mode
João Távora [Wed, 9 May 2018 11:24:10 +0000 (12:24 +0100)]
Get rid of eglot-mode

* eglot.el (eglot--managed-mode): Don't call eglot-mode. When
shutting down, offer to kill server.
(mode-line-misc-info): Update to use eglot--managed-mode

6 years agoSimplify eglot--signal-textdocument/didchange
João Távora [Wed, 9 May 2018 09:58:28 +0000 (10:58 +0100)]
Simplify eglot--signal-textdocument/didchange

* eglot.el (eglot--recent-before-changes)
(eglot--recent-after-changes): Delete.
(eglot--recent-changes): New var.
(eglot--outstanding-edits-p, eglot--before-change)
(eglot--after-change): Rewrite.
(eglot--signal-textDocument/didChange): Rewrite.
(eglot--signal-textDocument/didOpen): Initialize
buffer-local eglot--recent-changes here.

6 years agoFix odd bugs and tweak stuff
João Távora [Wed, 9 May 2018 01:43:47 +0000 (02:43 +0100)]
Fix odd bugs and tweak stuff

* eglot.el (eglot--log-event): Insert before markers.
(eglot--process-receive): Shave lines.
(xref-backend-references): Use cl-return-from.
(eglot--log-event): Simplify
(eglot-completion-at-point): Saner annotation

6 years agoSupport workspace/applyedit
João Távora [Tue, 8 May 2018 15:07:07 +0000 (16:07 +0100)]
Support workspace/applyedit

* eglot.el (eglot--reply): Don't send result or error if not
provided.
(eglot--server-workspace/applyEdit): New server method.
(eglot--apply-text-edits): Rework.
(eglot--apply-workspace-edit): New helper.
(eglot-rename): Simplify.

6 years agoSupport textdocument/rename
João Távora [Tue, 8 May 2018 12:37:35 +0000 (13:37 +0100)]
Support textdocument/rename

* README.md: Mention rename support.

* eglot.el (eglot--uri-to-path): Handle uri hidden in keywords.
(eglot--apply-text-edits): New helper.
(eglot-rename): New interactive command.
(eglot--client-capabilities): Add rename capability.

6 years agoReasonable textdocument/documenthighlight support
João Távora [Tue, 8 May 2018 10:38:02 +0000 (11:38 +0100)]
Reasonable textdocument/documenthighlight support

* README.md: Update.

* eglot.el (eglot--current-buffer-TextDocumentPositionParams): New
helper.
(xref-backend-identifier-completion-table): Refactor a bit.
(xref-backend-identifier-at-point): Use when-let and
eglot--current-buffer-TextDocumentPositionParams
(xref-backend-definitions, xref-backend-references): Refactor a
bit.
(eglot-completion-at-point): Use
eglot--current-buffer-TextDocumentPositionParams
(eglot-eldoc-function): Rewrite to handle
textDocument/documentHighlight.
(eglot--highlights): New variable.
(eglot--client-capabilities): Update with support for documentHighlight.

6 years agoFix odd bugs
João Távora [Tue, 8 May 2018 01:05:03 +0000 (02:05 +0100)]
Fix odd bugs

* eglot.el (eglot--process-receive, eglot--request): Set status to
actual error message.
(eglot--managed-mode): Manage imenu-create-index-function
correctly.
(eglot--mode-line-format): Print error status.

6 years agoWhen killing server, always wait 3 seconds
João Távora [Tue, 8 May 2018 00:52:27 +0000 (01:52 +0100)]
When killing server, always wait 3 seconds

* eglot.el (eglot--request): Accept TIMEOUT param.

6 years agoTry to fix some textdocument/completion bugs
João Távora [Tue, 8 May 2018 00:46:30 +0000 (01:46 +0100)]
Try to fix some textdocument/completion bugs

* eglot.el (eglot-completion-at-point): Rework slightly.

6 years agoHalf-decent imenu support via textdocument/documentsymbol
João Távora [Mon, 7 May 2018 22:43:03 +0000 (23:43 +0100)]
Half-decent imenu support via textdocument/documentsymbol

* README.md: Update capability

* eglot.el (eglot--lsp-position-to-point): New function.
(eglot--managed-mode): Handle imenu-create-index-function.
(eglot--server-textDocument/publishDiagnostics): Use
eglot--lsp-position-to-point.
(eglot-imenu): New function.
(eglot--client-capabilities): Capable of documentSymbol.

6 years agoOnly request stuff that server says it's capable of
João Távora [Mon, 7 May 2018 21:56:20 +0000 (22:56 +0100)]
Only request stuff that server says it's capable of

* eglot.el (eglot--server-capable): New helper.
(eglot-xref-backend)
(xref-backend-identifier-completion-table)
(xref-backend-references, xref-backend-apropos)
(eglot-completion-at-point, eglot-eldoc-function): Use it.

6 years agoSimplify mode-line code with a helper.
João Távora [Mon, 7 May 2018 21:40:53 +0000 (22:40 +0100)]
Simplify mode-line code with a helper.

* eglot.el (eglot--mdoe-line-props): New helper.
(eglot--mode-line-format): Use it.

6 years agoGet rid of eglot--buffer-open-count
João Távora [Mon, 7 May 2018 21:16:28 +0000 (22:16 +0100)]
Get rid of eglot--buffer-open-count

Hasn't really proved useful yet.

* eglot.el (eglot--buffer-open-count): Remove.
(eglot--signal-textDocument/didOpen)
(eglot--signal-textDocument/didClose): Simplify.

6 years agoGet rid of eglot--special-buffer-process
João Távora [Mon, 7 May 2018 21:15:21 +0000 (22:15 +0100)]
Get rid of eglot--special-buffer-process

Hasn't really proved useful yet.

* eglot.el (eglot--special-buffer-process): Delete.
(eglot--current-process): Simplify.
(eglot--events-buffer): Simplify.

6 years ago* eglot.el: reformat to shave off some lines.
João Távora [Mon, 7 May 2018 21:14:06 +0000 (22:14 +0100)]
* eglot.el: reformat to shave off some lines.

6 years agoFix bug in hover support
João Távora [Mon, 7 May 2018 21:06:49 +0000 (22:06 +0100)]
Fix bug in hover support

* eldoc.el (eglot-eldoc-function): Use eglot--format-markup.
(subr-x): Require it.
(eglot--format-markup): Pacify byte-compiler.

6 years agoClean up client capabilities
João Távora [Mon, 7 May 2018 17:46:28 +0000 (18:46 +0100)]
Clean up client capabilities

* eglot.el (eglot--client-capabilities): Clean up client
capabilities.

6 years agoHalf-baked textdocument/hover support
João Távora [Mon, 7 May 2018 17:45:57 +0000 (18:45 +0100)]
Half-baked textdocument/hover support

* eglot.el (eglot--format-markup): New helper.
(eglot--managed-mode): Handle eldoc-documentation-function.
(eglot-eldoc-function): New function.

* README.md: update

6 years agoTweak the async request engine.
João Távora [Mon, 7 May 2018 17:43:30 +0000 (18:43 +0100)]
Tweak the async request engine.

* eglot.el (eglot--request): Return the continuation id.
(eglot--lambda): Move up in the file.
(eglot--sync-request): Use a catch-tag.

6 years agoExplain why didopen on after-revert-hook is a bad idea
João Távora [Mon, 7 May 2018 16:27:01 +0000 (17:27 +0100)]
Explain why didopen on after-revert-hook is a bad idea

The reason is that the global find-file-hook is called again, and that
already does the didOpen. Too many didOpen's would be bad.

* eglot.el (eglot--managed-mode): Remove commented lines.

6 years agoHalf-decent completion support
João Távora [Mon, 7 May 2018 16:23:27 +0000 (17:23 +0100)]
Half-decent completion support

* README.md: Update.

* eglot.el (eglot--kind-names): New variable.
(eglot--managed-mode): Handle completion-at-point-functions.
(eglot-completion-at-point): New function.

6 years agoSolve another textdocument/didchange bug
João Távora [Mon, 7 May 2018 15:32:23 +0000 (16:32 +0100)]
Solve another textdocument/didchange bug

* eglot.el (eglot--signal-textDocument/didChange): Rework a bit.
(eglot--after-change): Store the actual after-text in the
eglot--recent-after-changes.

6 years agoSupport javascript's javascript-typescript-langserver
João Távora [Mon, 7 May 2018 14:04:02 +0000 (15:04 +0100)]
Support javascript's javascript-typescript-langserver

* README.md: Improve a bit

* eglot.el (eglot--make-process): Take MANAGED-MAJOR-MODE arg
(eglot-executables): Add basic javascript support.
(eglot--connect): Pass mode to eglot--make-process
(eglot--interactive): Check that guessed command is a listp.
(eglot): Minor improvement to message.
(eglot--current-buffer-TextDocumentItem): Guess language from mode
symbol.

6 years agoIncrease request timeout length to 10 seconds
João Távora [Mon, 7 May 2018 12:45:10 +0000 (13:45 +0100)]
Increase request timeout length to 10 seconds

* eglot.el (eglot-request-timeout): New var.
(eglot--request): Use it.

6 years agoWorkaround two suspected emacs bugs
João Távora [Mon, 7 May 2018 12:42:56 +0000 (13:42 +0100)]
Workaround two suspected emacs bugs

* eglot.el (eglot--process-filter): Use a proper unique tag. Use
unwind-protect.
(eglot--sync-request): Rework.
(eglot--server-client/registerCapability): Use a proper done tag.

6 years agoEtoomanylambdas
João Távora [Mon, 7 May 2018 11:18:08 +0000 (12:18 +0100)]
Etoomanylambdas

* eglot.el (eglot--sync-request): Remove a lambda.

6 years agoFix the odd bug here and there
João Távora [Mon, 7 May 2018 10:53:44 +0000 (11:53 +0100)]
Fix the odd bug here and there

* eglot.el (eglot--connect): Activate editing mode where
applicable here.
(eglot, eglot-reconnect): Not here or here.
(eglot--process-sentinel): Catch auto-reconnect errors.
(eglot--notify): Dont send 'id=null', it messes up js's lsp
(eglot--reply): Do send id here.
(eglot--log-event): Simplify protocol. Complexify implementation.
(eglot--process-receive, eglot--process-send): Simplify
eglot--log-event call.
(eglot--request, eglot--notify, eglot--reply): Simplify
eglot--process-send call
(eglot--server-client/registerCapability): Fix bug when replying
with wrong id.
(eglot--xref-reset-known-symbols): Take DUMMY arg.

6 years agoHalf-decent xref support
João Távora [Sat, 5 May 2018 10:26:12 +0000 (11:26 +0100)]
Half-decent xref support

* eglot.el
(eglot--xref-known-symbols): New hacky var.
(eglot--xref-reset-known-symbols): New helper.
(xref-find-definitions, xref-find-references): Advise after to
call the new helper.
(xref-backend-identifier-completion-table): Rework.
(eglot--xref-make): New helper.
(xref-backend-definitions): Use it.
(xref-backend-references, xref-backend-apropos): Implement.
(eglot--obj): Add a debug spec.
(eglot--lambda): Add debug spec.

6 years agoVery basic xref support
João Távora [Sat, 5 May 2018 01:29:06 +0000 (02:29 +0100)]
Very basic xref support

* eglot.el (eglot--pos-to-lisp-position): Move up.
(eglot--mapply, eglot--lambda): New helpers.
(eglot--uri-to-path): New helper.
(eglot--managed-mode): Manage xref-backend-functions.
(eglot-xref-backend): New function.
(xref-backend-identifier-completion-table)
(xref-backend-identifier-at-point)
(xref-backend-definitions): New methods.
(xref-backend-references)
(xref-backend-apropos): New methods, still unimplemented.

6 years agoNew helper eglot--sync-request
João Távora [Sat, 5 May 2018 01:16:10 +0000 (02:16 +0100)]
New helper eglot--sync-request

This should help with xref definitions

* eglot.el (eglot--request): Rework a bit. Continuation is always
cleared on timeout, regardless of user-supplied fn.
(eglot--sync-request): New function.
(eglot--process-receive): watch out for vector results.

6 years agoCleanup mistake with textdocumentitem and textdocumentidentifier
João Távora [Sat, 5 May 2018 01:24:37 +0000 (02:24 +0100)]
Cleanup mistake with textdocumentitem and textdocumentidentifier

Also introduce eglot--path-to-uri

* eglot.el (eglot--path-to-uri): Rename from eglot--uri and rework.
(eglot--connect): Use it.
(eglot--current-buffer-TextDocumentIdentifier): New function.
(eglot--current-buffer-VersionedTextDocumentIdentifier)
(eglot--signal-textDocument/didChange)
(eglot--signal-textDocument/didClose)
(eglot--signal-textDocument/willSave)
(eglot--signal-textDocument/didSave): Use it.

6 years agoHandle dynamic registration in general (but nothing specific yet)
João Távora [Fri, 4 May 2018 14:19:19 +0000 (15:19 +0100)]
Handle dynamic registration in general (but nothing specific yet)

* eglot.el (eglot--server-client/registerCapability): Implement.
(eglot--register-workspace/didChangeWatchedFiles): Dummy registrator.

6 years agoHonour textdocumentsync
João Távora [Fri, 4 May 2018 14:02:03 +0000 (15:02 +0100)]
Honour textdocumentsync

* eglot.el (eglot--signal-textDocument/didChange): Honour textDocumentSync

6 years agoBe quite explicit about our lack of capabilities right now
João Távora [Fri, 4 May 2018 13:42:02 +0000 (14:42 +0100)]
Be quite explicit about our lack of capabilities right now

* eglot.el (eglot--client-capabilities): Spread out.

6 years agoUse rooturi instead of rootpath
João Távora [Fri, 4 May 2018 13:29:40 +0000 (14:29 +0100)]
Use rooturi instead of rootpath

* eglot.el (eglot--connect)
(eglot--current-buffer-VersionedTextDocumentIdentifier): Use
eglot--uri.
(eglot--uri): New function.

6 years agoMake reported capabilities into its own function
João Távora [Fri, 4 May 2018 13:18:12 +0000 (14:18 +0100)]
Make reported capabilities into its own function

* eglot.el (eglot--client-capabilities): New function.
(eglot--connect): Use it.

6 years agoInclude source info in diagnostics
João Távora [Fri, 4 May 2018 13:15:41 +0000 (14:15 +0100)]
Include source info in diagnostics

* eglot.el (eglot--server-textDocument/publishDiagnostics):
Include source info.

6 years agoReply to client/registercapability (don't handle it yet)
João Távora [Fri, 4 May 2018 12:36:33 +0000 (13:36 +0100)]
Reply to client/registercapability (don't handle it yet)

* eglot.el (eglot--server-client/registerCapability): New
function.

6 years agoHandle requests from server correctly
João Távora [Fri, 4 May 2018 11:17:26 +0000 (12:17 +0100)]
Handle requests from server correctly

* eglot.el (eglot--process-receive): Redesign.
(eglot--process-send): Take REPLY arg. Discover if message is error.
(eglot--reply): new function
(eglot--log-event): Tweak docstring.
(eglot--process-receive): Reply with -32601 if unimplemented.
(eglot--server-window/showMessageRequest)
(eglot--server-client/registerCapability): Use eglot--reply

6 years agoDon't auto-reconnect if last attempt lasted less than 3 seconds
João Távora [Fri, 4 May 2018 11:03:51 +0000 (12:03 +0100)]
Don't auto-reconnect if last attempt lasted less than 3 seconds

* eglot.el (eglot--inhibit-auto-reconnect): New var.
(eglot--process-sentinel): Use it.

6 years agoWorkaround rls's regusal to treat nil as empty json object
João Távora [Fri, 4 May 2018 10:54:06 +0000 (11:54 +0100)]
Workaround rls's regusal to treat nil as empty json object

* eglot.el (eglot--connect): Use dummy params.

6 years agoEglot-editing-mode becomes eglot--managed-mode
João Távora [Fri, 4 May 2018 09:49:34 +0000 (10:49 +0100)]
Eglot-editing-mode becomes eglot--managed-mode

* eglot.el (eglot--sentinel): Use eglot--managed-mode.
(eglot--managed-mode-map): Renamed from eglot-editing-mode-map.
(eglot--managed-mode): Renamed from eglot-editing-mode.
(eglot-mode): Simplify.
(eglot--buffer-managed-p): New function.
(eglot--maybe-activate-editing-mode): Simplify.

6 years agoMake m-x eglot's interactive spec a separate function
João Távora [Fri, 4 May 2018 09:47:17 +0000 (10:47 +0100)]
Make m-x eglot's interactive spec a separate function

* eglot.el (eglot--interactive): New function.
(eglot): Rework a little.

6 years agoWhen user declines to reconnect, first quit existing server
João Távora [Fri, 4 May 2018 00:25:13 +0000 (01:25 +0100)]
When user declines to reconnect, first quit existing server

* eglot.el (eglot): Rework reconnection logic.

6 years agoConnect to lsp server via tcp
João Távora [Fri, 4 May 2018 10:21:11 +0000 (11:21 +0100)]
Connect to lsp server via tcp

* eglot.el (eglot--make-process): Rename from
eglot-make-local-process.
(eglot): Fix docstring and rework.
(eglot--bootstrap-fn): Remove
(eglot--contact): New process-local var.
(eglot--connect): Take CONTACT arg.
(eglot--reconnect): Rework.

6 years agoMore correctly keep track of didopen/didclose per buffer
João Távora [Fri, 4 May 2018 00:20:13 +0000 (01:20 +0100)]
More correctly keep track of didopen/didclose per buffer

* eglot.el (eglot--buffer-open-count): Now a process-local var.
(eglot--signal-textDocument/didOpen, eglot--signal-textDocument/didClose):
Use it.

6 years agoFix mode-line mouse-clicks from outside selected window
João Távora [Thu, 3 May 2018 23:25:03 +0000 (00:25 +0100)]
Fix mode-line mouse-clicks from outside selected window

* eglot.el (eglot--mode-line-call): New helper.
(eglot--mode-line-format): Use it.

6 years ago* eglot.el (eglot--process-receive): skip null method notifs.
João Távora [Thu, 3 May 2018 23:12:53 +0000 (00:12 +0100)]
* eglot.el (eglot--process-receive): skip null method notifs.

6 years agoTrim some edges and add a bunch of boring rpc methods
João Távora [Thu, 3 May 2018 22:59:56 +0000 (23:59 +0100)]
Trim some edges and add a bunch of boring rpc methods

* eglot.el (eglot--connect): Don't call eglot--protocol-initialize.
(eglot--process-filter): Break long line.
(eglot--process-receive): Also pass id to handler if a server request.
(eglot--log): New helper.
(eglot-editing-mode): Manage before-revert-hook,
after-revert-hook, before-save-hook, after-save-hook.
(eglot--protocol-initialize): Removed.
(eglot--server-window/showMessage): Simplify.
(eglot--server-window/showMessageRequest)
(eglot--server-window/logMessage, eglot--server-telemetry/event):
New handlers.
(eglot--signal-textDocument/willSave)
(eglot--signal-textDocument/didSave): New notifications.
(eglot--signal-textDocument/didOpen)
(eglot--signal-textDocument/didClose): Check
eglot--buffer-open-count.
(eglot--buffer-open-count): New var.

6 years agoFix a couple of rust-related edge cases
João Távora [Thu, 3 May 2018 21:44:13 +0000 (22:44 +0100)]
Fix a couple of rust-related edge cases

* eglot.el (eglot--server-window/progress): Allow other keys.
(eglot--server-textDocument/publishDiagnostics): Allow :group in diagnostic
spec.

6 years agoFix textdocument/didchange
João Távora [Thu, 3 May 2018 21:42:13 +0000 (22:42 +0100)]
Fix textdocument/didchange

* eglot.el (eglot-editing-mode): Manage before-change-functions.
(eglot--recent-changes): Deleted.
(eglot--recent-before-changes): New var.
(eglot--recent-after-changes): Renamed from eglot--recent-changes.
(eglot--pos-to-lsp-position, eglot--before-change): New helpers.
(eglot--after-change): Rework.
(eglot--signal-textDocument/didChange): Rework.

6 years agoRename rpc methods for clarity
João Távora [Thu, 3 May 2018 15:14:35 +0000 (16:14 +0100)]
Rename rpc methods for clarity

* eglot.el (eglot--process-receive): Search for RPC server methods
under `eglot--server-'
(eglot-editing-mode, eglot--maybe-activate-editing-mode): Use new
signal names.
(eglot--server-window/showMessage): Rename from
eglot--window/showMessage.
(eglot--server-textDocument/publishDiagnostics): Renamed from
eglot--textDocument/publishDiagnostics.
(eglot--current-buffer-versioned-identifier): Remove.
(eglot--current-buffer-VersionedTextDocumentIdentifier): Use
eglot--versioned-identifier.
(eglot--signal-textDocument/didChange): Renamed from
eglot--maybe-signal-didChange.
(eglot--signal-textDocument/didOpen): Renamed from
eglot--signalDidOpen.
(eglot--signal-textDocument/didClose): Rename from
eglot--signalDidClose.
(eglot-flymake-backend): Call eglot--signal-textDocument/didChange.
(eglot--server-window/progress): Rename from
eglot--window/progress.

6 years agoReorganize file
João Távora [Thu, 3 May 2018 15:04:03 +0000 (16:04 +0100)]
Reorganize file

* eglot.el (eglot-mode-line): Move up.
(eglot-make-local-process, eglot--all-major-modes, eglot--obj)
(eglot--project-short-name, eglot--all-major-modes)
(eglot-reconnect, eglot--maybe-activate-editing-mode)
(eglot--protocol-initialize)
(eglot--window/showMessage, eglot--current-flymake-report-fn)
(eglot--unreported-diagnostics)
(eglot--textDocument/publishDiagnostics, eglot--signalDidOpen)
(eglot--signalDidClose): Move around.
(eglot-quit-server): Renamed to eglot-shutdown.
(eglot-shutdown): New function

6 years agoDelete two useless forward declarations
João Távora [Thu, 3 May 2018 14:47:39 +0000 (15:47 +0100)]
Delete two useless forward declarations

* eglot.el (eglot-mode, eglot-editing-mode-map): Remove forward decls.

6 years agoFix flymake diagnostic positions
João Távora [Thu, 3 May 2018 14:46:27 +0000 (15:46 +0100)]
Fix flymake diagnostic positions

It's better not to use flymake-diag-region here.

* eglot.el (eglot--textDocument/publishDiagnostics):
Calculate position by hand.

6 years agoMust re-announce didopen after reconnect
João Távora [Thu, 3 May 2018 14:45:30 +0000 (15:45 +0100)]
Must re-announce didopen after reconnect

* eglot.el (eglot-reconnect): Also call
eglot--maybe-activate-editing-mode for all buffers.

6 years agoFix another flymake sync bug
João Távora [Thu, 3 May 2018 14:10:32 +0000 (15:10 +0100)]
Fix another flymake sync bug

* eglot.el (eglot-flymake-backend): Only report unreported sometimes.
(eglot--maybe-activate-editing-mode): Start flymake explicitly
when didOpen.
(eglot--textDocument/publishDiagnostics): No need to set
unreported-diagnostics to nil.
(flymake): Require it.

6 years agoMake m-x eglot the main entry point
João Távora [Thu, 3 May 2018 13:54:39 +0000 (14:54 +0100)]
Make m-x eglot the main entry point

* eglot.el (eglot-new-process): Removed
(eglot): Rename from eglot-new-process.
(eglot-editing-mode): Mention M-x eglot

* README.md: Use M-x eglot

6 years agoFix assorted bugs
João Távora [Thu, 3 May 2018 13:49:43 +0000 (14:49 +0100)]
Fix assorted bugs

* eglot.el (eglot--special-buffer-process): Must be buffer-local.
(eglot--define-process-var): Fix disaster waiting to happen.
(eglot--process-receive): Explicitly pass PROC to
eglot--pending-continuations.
(eglot--textDocument/publishDiagnostics): Clear unreported diagnostics

6 years agoWatch for files opened under umbrella of existing process
João Távora [Thu, 3 May 2018 13:08:37 +0000 (14:08 +0100)]
Watch for files opened under umbrella of existing process

* eglot.el (eglot--connect): Call success-fn with a proc.
(eglot-reconnect): Adapt to new eglot--connect.
(eglot-new-process): Call eglot--maybe-activate-editing-mode
(eglot--maybe-activate-editing-mode): New function.
(find-file-hook): Add it here.

6 years agoMultiple servers per project are possible
João Távora [Thu, 3 May 2018 12:37:04 +0000 (13:37 +0100)]
Multiple servers per project are possible

A server manages a specific major-mode within a project.

* eglot.el (eglot--processes-by-project): Add docstring.
(eglot--current-process): Search new eglot--processes-by-project
format.
(eglot--major-mode): New variable.
(eglot--moribund, eglot--project): Update docstring.
(eglot--project-short-name, eglot--all-major-modes): New helpers.
(eglot--connect): Rework.
(eglot-new-process): Rework severely.
(eglot--command-history): New variable.
(eglot--process-sentinel): Use new
eglot--processes-by-project. Update mode line.
(eglot-editing-mode): Don't start processes, just suggest it.

6 years agoAppease checkdoc.el
João Távora [Thu, 3 May 2018 12:32:20 +0000 (13:32 +0100)]
Appease checkdoc.el

* eglot.el (eglot--process-send, eglot--next-request-id)
(eglot--current-buffer-VersionedTextDocumentIdentifier)
(eglot--current-buffer-TextDocumentItem)
(eglot--after-change, eglot--signalDidOpen)
(eglot--signalDidClose, eglot--maybe-signal-didChange):
Add docstring.

6 years agoSimplify flymake integration
João Távora [Thu, 3 May 2018 11:05:37 +0000 (12:05 +0100)]
Simplify flymake integration

And get rid of the ridiculous environment thingy

* eglot.el (eglot--process-sentinel): Continuations are triplets.
(eglot--environment-vars, eglot--environment): Remove.
(eglot--process-receive): Simplify.
(eglot--unreported-diagnostics): New variable.
(eglot--textDocument/publishDiagnostics): Simplify.
(eglot-flymake-backend): Report unreported diagnostics.

6 years agoSignal textdocument/didclose
João Távora [Thu, 3 May 2018 10:49:24 +0000 (11:49 +0100)]
Signal textdocument/didclose

* eglot.el (eglot-editing-mode): Signal didClose.
(eglot--signalDidClose): New.

6 years agoRework connection restarting again
João Távora [Thu, 3 May 2018 10:48:35 +0000 (11:48 +0100)]
Rework connection restarting again

Quitting a process removes it from the project.

* eglot.el (eglot-editing-mode,eglot-mode): Forward declare.
(eglot--project): New process-local var.
(eglot--connect): Takes a project.
(eglot-new-process): Rework.
(eglot--sentinel): Remove proc from eglot--processes-by-project.

6 years agoRedesign and simplify parser
João Távora [Thu, 3 May 2018 10:39:49 +0000 (11:39 +0100)]
Redesign and simplify parser

Fix horrible bugs. This is the correct way.

* eglot.el (eglot--process-filter): Redesign.

6 years agoAuto-reconnect on unexpected connection loss
João Távora [Wed, 2 May 2018 16:00:46 +0000 (17:00 +0100)]
Auto-reconnect on unexpected connection loss

* eglot.el (eglot-reconnect): Only quit if indeed not quit
already.
(eglot-new-process): Burn the command in the bootstrap fn.
(eglot--process-sentinel): Automatically reconnect if closed
unexpectedly.
(eglot--warn): Also message to *Messages*

6 years agoReady to start fixing flymake integration
João Távora [Wed, 2 May 2018 14:49:41 +0000 (15:49 +0100)]
Ready to start fixing flymake integration

* eglot.el (eglot-editing-mode): Turn on flymake-mode.
(eglot-flymake-backend): Always start by reporting no diagnostics.
(eglot--textDocument/publishDiagnostics): No annoying message.

6 years agoSlightly more user friendly start
João Távora [Wed, 2 May 2018 14:36:26 +0000 (15:36 +0100)]
Slightly more user friendly start

* eglot.el (eglot-new-process): signal DidOpen for every file in project.
(eglot-editing-mode): Offer to start process.

6 years agoDon't clutter ui with warnings
João Távora [Wed, 2 May 2018 14:35:22 +0000 (15:35 +0100)]
Don't clutter ui with warnings

* eglot.el (warnings): require it.
(eglot--warn): set warning-minimum-level

6 years agoRework commands for connecting and reconnecting
João Távora [Wed, 2 May 2018 14:06:50 +0000 (15:06 +0100)]
Rework commands for connecting and reconnecting

* eglot.el (eglot--current-process-or-lose): Add doc.
(eglot--command): Remove.
(eglot--bootstrap-fn): New process-local variable.
(eglot--connect): Redesign.
(eglot-make-local-process): New function.
(eglot-reconnect): New interactive command.
(eglot-new-process): Redesign.
(eglot--process-sentinel): Add doc.
(eglot--protocol-initialize): Rework.
(eglot--mode-line-format): Use eglot-reconnect.

6 years agoLess obstrusive flymake stuff for now
João Távora [Wed, 2 May 2018 12:54:37 +0000 (13:54 +0100)]
Less obstrusive flymake stuff for now

* eglot.el (eglot--after-change, eglot-flymake-backend): Fix.

6 years agoEvents buffer uses eglot-mode, source buffers use eglot-editing-mode
João Távora [Wed, 2 May 2018 12:37:35 +0000 (13:37 +0100)]
Events buffer uses eglot-mode, source buffers use eglot-editing-mode

* eglot.el (eglot--special-buffer-process): New var.
(eglot--current-process): Consider eglot--special-buffer-process.
(eglot-events-buffer): Use eglot-mode
(eglot-editing-mode): New minor mode.
(eglot-mode): Turns on eglot-editing-mode maybe.

6 years agoChange status to error everytime an error is found
João Távora [Wed, 2 May 2018 12:33:02 +0000 (13:33 +0100)]
Change status to error everytime an error is found

* eglot.el (eglot--process-receive): Also set error status.
(eglot--request): Fix a compilation warning.

6 years agoCorrectly report what we currently are capable of
João Távora [Wed, 2 May 2018 12:32:13 +0000 (13:32 +0100)]
Correctly report what we currently are capable of

Which is almost nothing.

* eglot.el (eglot--protocol-initialize): Clean up.

6 years agoAdd eglot-clear-status interactive command
João Távora [Wed, 2 May 2018 12:31:26 +0000 (13:31 +0100)]
Add eglot-clear-status interactive command

* eglot.el (eglot-clear-status): New
(eglot-forget-pending-continuations): Fix bug.
(eglot--mode-line-format): Add link to eglot-clear-status.

6 years agoAuto update mode-line after setting some process properties
João Távora [Wed, 2 May 2018 12:28:18 +0000 (13:28 +0100)]
Auto update mode-line after setting some process properties

* eglot.el (eglot--define-process-var): Rework.
(eglot--short-name, eglot--spinner, eglot--status): Update mode-line
after setting it.

6 years agoStart experimenting with python
João Távora [Wed, 2 May 2018 11:05:47 +0000 (12:05 +0100)]
Start experimenting with python

* eglot.el (eglot-executables): Add pyls.

6 years agoDon't switch to possibly dead buffer in sentinel
João Távora [Wed, 2 May 2018 11:04:56 +0000 (12:04 +0100)]
Don't switch to possibly dead buffer in sentinel

* eglot.el (eglot--process-sentinel): Don't with-current-buffer.

6 years agoReport server status in the mode-line
João Távora [Tue, 1 May 2018 22:13:49 +0000 (23:13 +0100)]
Report server status in the mode-line

* eglot.el (eglot--status): New var.
(eglot--log-event): Try to be more useful for other stuff.
(eglot--protocol-initialize): Set status to nil on
successful connect.
(eglot--window/showMessage): Set status to error if needed.
(eglot--mode-line-format): Display status if serious.

6 years agoImplement spinners and rls's window/progress
João Távora [Tue, 1 May 2018 21:47:09 +0000 (22:47 +0100)]
Implement spinners and rls's window/progress

* eglot.el (eglot--window/progress): New.
(eglot--mode-line-format): Rework.
(eglot--snpinner): New var.
(compile): require it.

6 years agoFix parser to accept multiple messages in one chunk
João Távora [Tue, 1 May 2018 21:30:09 +0000 (22:30 +0100)]
Fix parser to accept multiple messages in one chunk

* eglot.el (eglot--process-filter): Redesign slightly.
(eglot--message-mark): Remove. don't need this.

6 years agoLay groundwork for uniform treatment of network connections
João Távora [Tue, 1 May 2018 09:46:06 +0000 (10:46 +0100)]
Lay groundwork for uniform treatment of network connections

* eglot.el (eglot--connect): New helper.
(eglot-new-process): Use it.
(pcase): Require it.

6 years agoDoc fixes
João Távora [Tue, 1 May 2018 09:18:31 +0000 (10:18 +0100)]
Doc fixes

* eglot.el (eglot-mode-map): Move up before minor mode.

6 years ago* eglot.el (eglot-mode-map): move up before minor mode.
João Távora [Tue, 1 May 2018 09:14:53 +0000 (10:14 +0100)]
* eglot.el (eglot-mode-map): move up before minor mode.

6 years agoStart working on this again
João Távora [Mon, 30 Apr 2018 17:54:54 +0000 (18:54 +0100)]
Start working on this again

* eglot.el (url-util): Require it.
(eglot--process-sentinel): pending continuations now are quads (added env).
(eglot--process-filter): Unwind message markers correctly if handling fails.
(eglot--obj): Simple macro.
(eglot--log-event): Add some info to logged event.
(eglot--environment-vars, eglot--environment): Helper vars.
(eglot--process-receive): Improve.
(eglot--process-send): Niver log.
(eglot--request): Use eglot--obj. Add environment.
(eglot--notify): New helper.
(eglot--protocol-initialize): RLS must like file://
(eglot--current-flymake-report-fn): New var.
(eglot--textDocument/publishDiagnostics): Use flymake from Emacs 26.
(eglot-mode): Proper minor mode.
(eglot--recent-changes, eglot--versioned-identifier): New stuff.
(eglot--current-buffer-versioned-identifier)
(eglot--current-buffer-VersionedTextDocumentIdentifier)
(eglot--current-buffer-TextDocumentItem, eglot--after-change)
(eglot--signalDidOpen, eglot--maybe-signal-didChange): New stuff.
(eglot-flymake-backend): More or less a flymake backend function.

6 years agoFix mode line
João Távora [Mon, 30 Apr 2018 12:39:16 +0000 (13:39 +0100)]
Fix mode line

* eglot.el (mode-line-misc-info): conditionalize to eglot-mode

6 years agoFix some byte-compilation warnings
João Távora [Mon, 30 Apr 2018 12:38:37 +0000 (13:38 +0100)]
Fix some byte-compilation warnings

7 years agoOverhaul async mechanism safety
João Távora [Wed, 16 Aug 2017 15:53:40 +0000 (16:53 +0100)]
Overhaul async mechanism safety

7 years agoSimplify `eglot--protocol-initialize`
João Távora [Wed, 16 Aug 2017 14:48:50 +0000 (15:48 +0100)]
Simplify `eglot--protocol-initialize`

* eglot.el (eglot--protocol-initialize): Simplify

7 years agoExperimental diagnostic overlays
João Távora [Wed, 16 Aug 2017 12:49:31 +0000 (13:49 +0100)]
Experimental diagnostic overlays

7 years agoMinor cleanup
João Távora [Wed, 16 Aug 2017 12:02:05 +0000 (13:02 +0100)]
Minor cleanup

7 years agoCancel timeouts when process dies unexpectedly
João Távora [Wed, 16 Aug 2017 11:58:20 +0000 (12:58 +0100)]
Cancel timeouts when process dies unexpectedly

7 years agoOrganize a bit
João Távora [Wed, 16 Aug 2017 11:50:53 +0000 (12:50 +0100)]
Organize a bit

7 years agoImprove `eglot--current-process'
João Távora [Wed, 16 Aug 2017 11:50:20 +0000 (12:50 +0100)]
Improve `eglot--current-process'

7 years agoHandle notifications
João Távora [Wed, 16 Aug 2017 11:49:24 +0000 (12:49 +0100)]
Handle notifications

7 years agoIntroduce and use `eglot--current-process-or-lose'
João Távora [Wed, 16 Aug 2017 11:13:52 +0000 (12:13 +0100)]
Introduce and use `eglot--current-process-or-lose'

7 years agoAdd a mode-line construct and some minor fanciness
João Távora [Wed, 16 Aug 2017 11:10:13 +0000 (12:10 +0100)]
Add a mode-line construct and some minor fanciness