Code Monkey home page Code Monkey logo

acme-lsp's Introduction

GitHub Actions Status Go Reference Go Report Card

acme-lsp

Language Server Protocol tools for acme text editor.

The main tool is acme-lsp, which listens for commands from the L command. It also watches for files created (New), loaded (Get), saved (Put), or deleted (Del) in acme, and tells the LSP server about these changes. The LSP server in turn responds by sending diagnostics information (compiler errors, lint errors, etc.) which are shown in an acme window. When Put is executed in an acme window, acme-lsp also organizes import paths in the window and formats it.

Currently, acme-lsp has been tested with gopls, go-langserver and pyls. Please report incompatibilities with those or other servers.

Installation

Install the latest release:

GO111MODULE=on go install 9fans.net/acme-lsp/cmd/acme-lsp@latest
GO111MODULE=on go install 9fans.net/acme-lsp/cmd/L@latest

gopls

First install the latest release of gopls:

GO111MODULE=on go install golang.org/x/tools/gopls@latest

Start acme-lsp like this:

acme-lsp -server '([/\\]go\.mod)|([/\\]go\.sum)|(\.go)$:gopls serve' -workspaces /path/to/mod1:/path/to/mod2

where mod1 and mod2 are module directories with a go.mod file. The set of workspace directories can be changed at runtime by using the L ws+ and L ws- sub-commands.

When Put is executed in an acme window editing .go file, acme-lsp will update import paths and gofmt the window buffer if needed. It also enables commands like L def (jump to defenition), L refs (list of references), etc. within acme. The L assist command opens a window where completion, hover, or signature help output is shown for the current cursor position in the .go file being edited.

If you want to change gopls settings, you can create a configuration file at UserConfigDir/acme-lsp/config.toml (the -showconfig flag prints the exact location) and then run acme-lsp without any flags. Example config file:

WorkspaceDirectories = [
	"/path/to/mod1",
	"/path/to/mod2",
]
FormatOnPut = true
CodeActionsOnPut = ["source.organizeImports"]

[Servers]
	[Servers.gopls]
	Command = ["gopls", "serve", "-rpc.trace"]
	StderrFile = "gopls.stderr.log"
	LogFile = "gopls.log"

		# These settings gets passed to gopls
		[Servers.gopls.Options]
		hoverKind = "FullDocumentation"

[[FilenameHandlers]]
  Pattern = "[/\\\\]go\\.mod$"
  LanguageID = "go.mod"
  ServerKey = "gopls"

[[FilenameHandlers]]
  Pattern = "[/\\\\]go\\.sum$"
  LanguageID = "go.sum"
  ServerKey = "gopls"

[[FilenameHandlers]]
  Pattern = "\\.go$"
  LanguageID = "go"
  ServerKey = "gopls"

Hints & Tips

  • If a file gets out of sync in the LSP server (e.g. because you edited the file outside of acme), executing Get on the file will update it in the LSP server.

  • Create scripts like Ldef, Lrefs, Ltype, etc., so that you can easily execute those commands with a single middle click:

for(cmd in comp def fmt hov impls refs rn sig syms type assist ws ws+ ws-){
	> L^$cmd {
		echo '#!/bin/rc'
		echo exec L $cmd '$*'
	}
	chmod +x L^$cmd
}
  • Create custom keybindings that allow you to do completion (L comp -e) and show signature help (L sig) while you're typing. This can be achieved by using a general keybinding daemon (e.g. xbindkeys in X11) and running acmefocused.

See also

acme-lsp's People

Contributors

fhs avatar rsc avatar tw4452852 avatar farhaven avatar ilanpillemer avatar mibk avatar

Stargazers

Connor Taffe avatar Vincent Murphy avatar Dragos avatar standenboy avatar Tahmid Khan avatar Dirk Arnez avatar  avatar  avatar Pedro L. Ramos avatar  avatar Sandy avatar Blue avatar Kiril Zadgorski avatar  avatar  avatar Meelis Utt avatar Antonio avatar Gio Rice avatar Ted Summer avatar Adilson Nunes avatar  avatar  avatar Leo avatar Alex avatar Maximilian Koeniger avatar Pete avatar Quico Moya avatar  avatar Jonathan avatar Carlos Johnson avatar Jason Fuchs avatar YoungChief avatar ~hedy avatar Breno Pinheiro avatar Thomas Hatzopoulos avatar  avatar Lewis Weinberger avatar Danilo Gvozdenovic avatar smallissue avatar Justin Davis avatar Thim Cederlund avatar Lu Hui avatar Eli Mellen avatar Yashar avatar tsr avatar Brian Zhou avatar Mark Boudreau avatar exponential avatar Artur F. avatar Alex Karle avatar Adnan Muradbegović avatar Sara Burke avatar Qingyao Sun avatar Moteesh avatar Siegmentation Fault avatar Emily Easteal avatar Julia avatar Thomas Du Plessis avatar Thomas Schranz avatar Michael Kohl avatar Adam Kessler avatar Todd Martin avatar Lilly Cham avatar AN Long avatar David Selassie avatar Xiaodong Xu avatar Yghor Kerscher avatar Emilia Dunfelt avatar Alex avatar eau avatar Innes Anderson-Morrison avatar Dwight Spencer (denzuko@mastodon.social) avatar Omar Polo avatar Gabriel avatar eg avatar Amirreza Askarpour avatar woatungau avatar Jake D'Cruz avatar kota avatar  avatar Julien Blanchard avatar Tristan Colgate-McFarlane avatar  avatar bottom chained avatar  avatar Jeff Williams avatar  avatar  avatar Alex Kritikos avatar Andras Horvath avatar Alexis Hildebrandt avatar tsh avatar  avatar  avatar  avatar Jorge Gomez avatar Jochen Schneider avatar  avatar crepuscular dispatch avatar  avatar

Watchers

Matt Singletary avatar marius a. eriksen avatar  avatar  avatar  avatar Hank Donnay avatar Sevki avatar  avatar Mathieu avatar James Cloos avatar  avatar Tim Käck avatar  avatar  avatar  avatar

acme-lsp's Issues

acme-lsp doesn't work in Windows

Acme-lsp should work fine in Edwood (Go port of acme), but it doesn't work on Windows because it has no plumber. See rjkroege/edwood#48 (comment).

This is one reason to move to using 9P (or something else?) for communication between L and acme-lsp, instead of using the plumber. Jump-to-definition (L def) still won't work without a plumber but at least it can print the location. Ultimately, someone needs to port the plumber to Windows for good editing experience.

Automatically launch acme-lsp at acme startup

I am relatively new to Acme, so I am not aware if there is a principle of "autostart".

Can Acme automatically launch acme-lsp when it starts? If so, how? If not, what is your current workflow to start acme-lsp?

Thanks and sorry for the n00b question!

Add support for FormattingOptions in config.toml

Currently, when acme-lsp sends a Formatting command to the server, it implicitly provides the zero-value for FormattingOptions, amounting to a TabSize = 0 and InsertSpaces = false.

When using the YAPF plugin with python-lsp-server, these values override the configured behavior. In my case, I'd like to adhere to the PEP-8 standard, which would require TabSize = 4 and InsertSpaces = true.

Given all of that, I'd like to propose adding per-server support for FormattingOptions. The result would be something like:

[Servers]
	[Servers.pylsp]
	Command = ["pylsp", "-vvv"]
	StderrFile = "pylsp.stderr.log"
	LogFile = "pylsp.log"

		# These settings get passed to pylsp
		[Servers.pylsp.Options]
		"pylsp.plugins.autopep8.enabled" = false
		"pylsp.plugins.yapf.enabled" = true

		# These settings get passed on Format
		[Servers.pylsp.FormattingOptions]
		TabSize = 4
		InsertSpaces = true

If this seems reasonable, I'd be happy to open a PR to add this.

Please let me know your thoughts.

Trying to get deno lsp to work

I tried to get the typescript language server from deno to work.

L fmt on json files works great.

L ws works great

L syms in ts files returns No symbols found, other commands return similar issues.

Heres my config

WorkspaceDirectories = [
	"/home/patrick/jsapp/"
]

FormatOnPut = true
CodeActionsOnPut = ["source.organizeImports"]

[Servers]
	[Servers.deno]
	Command = ["deno", "lsp"]
	StderrFile = "deno.stderr.log"
	LogFile = "deno.log"

[[FilenameHandlers]]
  Pattern = "\\.jsx$"
  LanguageID = "javascriptreact"
  ServerKey = "deno"

[[FilenameHandlers]]
  Pattern = "\\.js$"
  LanguageID = "javascript"
  ServerKey = "deno"

[[FilenameHandlers]]
  Pattern = "\\.ts$"
  LanguageID = "typescript"
  ServerKey = "deno"

[[FilenameHandlers]]
  Pattern = "\\.vue$"
  LanguageID = "typescript"
  ServerKey = "deno"

[[FilenameHandlers]]
  Pattern = "\\.tsx$"
  LanguageID = "typescriptreact"
  ServerKey = "deno"

[[FilenameHandlers]]
  Pattern = "\\.json$"
  LanguageID = "json"
  ServerKey = "deno"

Not much to see with -v

patrick@atreides:~$ acme-lsp -v
2023/11/15 20:28:53 proxy: jsonrpc2 connection disconnected
2023/11/15 20:28:54 proxy: jsonrpc2 connection disconnected

Server does seem to start correctly though:

patrick@atreides:~$ cat .cache/acme-lsp/deno.stderr.log 
Starting Deno language server...
  version: 1.37.2 (release, x86_64-unknown-linux-gnu)
  executable: /snap/deno/120/deno
Server ready.
patrick@atreides:~$ cat .cache/acme-lsp/deno.log 
patrick@atreides:~$ 

L def fails to run due to acme-lsp.rpc: connect: no such file or directory

Hi team,

I'm running acme-lsp, acmefocued with L def, however, the L def is giving me the following errors:

2021/12/22 22:49:18 dial failed: dial unix /tmp/ns.ian.:0/acme-lsp.rpc: connect: no such file or directory

At the meantime, the acme-lsp is running fine though:

$  ps aux | grep acme-lsp
ian         22857   0.0  0.0 34122728    732 s001  S<+  10:53PM   0:00.00 grep acme-lsp
ian         22522   0.0  0.0 34831536   4476   ??  S<   10:45PM   0:00.12 acme-lsp -hidediag=true -v

Any idea, how to debug this one?

kotlin-language-server crashes during initialization

Does acme-lsp work with JSON-RPC communications with a lsp-server?
I am trying to get it to work with https://github.com/fwcd/kotlin-language-server
But I get errors like the below.

2019/10/25 13:55:18 log: LSP Error: client Internal error: java.lang.reflect.InvocationTargetException 2019/10/25 13:55:18 log: LSP Error: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException 2019/10/25 13:55:18 log: LSP Error: at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:67) 2019/10/25 13:55:18 log: LSP Error: at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.request(GenericEndpoint.java:120) 2019/10/25 13:55:18 log: LSP Error: at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleRequest(RemoteEndpoint.java:261) 2019/10/25 13:55:18 log: LSP Error: at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:190) 2019/10/25 13:55:18 log: LSP Error: at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:192) 2019/10/25 13:55:18 log: LSP Error: at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94) 2019/10/25 13:55:18 log: LSP Error: at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113) 2019/10/25 13:55:18 log: LSP Error: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 2019/10/25 13:55:18 log: LSP Error: at java.util.concurrent.FutureTask.run(FutureTask.java:266) 2019/10/25 13:55:18 log: LSP Error: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 2019/10/25 13:55:18 log: LSP Error: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 2019/10/25 13:55:18 log: LSP Error: at java.lang.Thread.run(Thread.java:748) 2019/10/25 13:55:18 log: LSP Error: Caused by: java.lang.reflect.InvocationTargetException 2019/10/25 13:55:18 log: LSP Error: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2019/10/25 13:55:18 log: LSP Error: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 2019/10/25 13:55:18 log: LSP Error: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 2019/10/25 13:55:18 log: LSP Error: at java.lang.reflect.Method.invoke(Method.java:498) 2019/10/25 13:55:18 log: LSP Error: at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:65) 2019/10/25 13:55:18 log: LSP Error: ... 11 more 2019/10/25 13:55:18 log: LSP Error: Caused by: java.lang.NullPointerException 2019/10/25 13:55:18 log: LSP Error: at sun.nio.fs.UnixFileSystem$3.matches(UnixFileSystem.java:310) 2019/10/25 13:55:18 log: LSP Error: at org.javacs.kt.SourceFilesKt$findSourceFiles$1.test(SourceFiles.kt:212) 2019/10/25 13:55:18 log: LSP Error: at org.javacs.kt.SourceFilesKt$findSourceFiles$1.test(SourceFiles.kt) 2019/10/25 13:55:18 log: LSP Error: at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:174) 2019/10/25 13:55:18 log: LSP Error: at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) 2019/10/25 13:55:18 log: LSP Error: at java.util.Iterator.forEachRemaining(Iterator.java:116) 2019/10/25 13:55:18 log: LSP Error: at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801) 2019/10/25 13:55:18 log: LSP Error: at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) 2019/10/25 13:55:18 log: LSP Error: at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) 2019/10/25 13:55:18 log: LSP Error: at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) 2019/10/25 13:55:18 log: LSP Error: at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) 2019/10/25 13:55:18 log: LSP Error: at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566) 2019/10/25 13:55:18 log: LSP Error: at org.javacs.kt.SourceFilesKt.findSourceFiles(SourceFiles.kt:213) 2019/10/25 13:55:18 log: LSP Error: at org.javacs.kt.SourceFilesKt.access$findSourceFiles(SourceFiles.kt:1) 2019/10/25 13:55:18 log: LSP Error: at org.javacs.kt.SourceFiles.addWorkspaceRoot(SourceFiles.kt:145) 2019/10/25 13:55:18 log: LSP Error: at org.javacs.kt.KotlinLanguageServer.initialize(KotlinLanguageServer.kt:75) 2019/10/25 13:55:18 log: LSP Error: ... 16 more 2019/10/25 13:55:18 didOpen failed in file manager: failed to connect to language server ["kotlin-language-server"]: initialize failed: Internal error. 2019/10/25 13:56:58 log: LSP Error: client Internal error: java.lang.reflect.InvocationTargetException 2019/10/25 13:56:58 log: LSP Error: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException 2019/10/25 13:56:58 log: LSP Error: at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:67) 2019/10/25 13:56:58 log: LSP Error: at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.request(GenericEndpoint.java:120) 2019/10/25 13:56:58 log: LSP Error: at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleRequest(RemoteEndpoint.java:261) 2019/10/25 13:56:58 log: LSP Error: at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:190) 2019/10/25 13:56:58 log: LSP Error: at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:192) 2019/10/25 13:56:58 log: LSP Error: at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94) 2019/10/25 13:56:58 log: LSP Error: at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113) 2019/10/25 13:56:58 log: LSP Error: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 2019/10/25 13:56:58 log: LSP Error: at java.util.concurrent.FutureTask.run(FutureTask.java:266) 2019/10/25 13:56:58 log: LSP Error: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 2019/10/25 13:56:58 log: LSP Error: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 2019/10/25 13:56:58 log: LSP Error: at java.lang.Thread.run(Thread.java:748) 2019/10/25 13:56:58 log: LSP Error: Caused by: java.lang.reflect.InvocationTargetException 2019/10/25 13:56:58 log: LSP Error: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2019/10/25 13:56:58 log: LSP Error: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 2019/10/25 13:56:58 log: LSP Error: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 2019/10/25 13:56:58 log: LSP Error: at java.lang.reflect.Method.invoke(Method.java:498) 2019/10/25 13:56:58 log: LSP Error: at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:65) 2019/10/25 13:56:58 log: LSP Error: ... 11 more 2019/10/25 13:56:58 log: LSP Error: Caused by: java.lang.NullPointerException 2019/10/25 13:56:58 log: LSP Error: at sun.nio.fs.UnixFileSystem$3.matches(UnixFileSystem.java:310) 2019/10/25 13:56:58 log: LSP Error: at org.javacs.kt.SourceFilesKt$findSourceFiles$1.test(SourceFiles.kt:212) 2019/10/25 13:56:58 log: LSP Error: at org.javacs.kt.SourceFilesKt$findSourceFiles$1.test(SourceFiles.kt) 2019/10/25 13:56:58 log: LSP Error: at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:174) 2019/10/25 13:56:58 log: LSP Error: at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) 2019/10/25 13:56:58 log: LSP Error: at java.util.Iterator.forEachRemaining(Iterator.java:116) 2019/10/25 13:56:58 log: LSP Error: at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801) 2019/10/25 13:56:58 log: LSP Error: at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) 2019/10/25 13:56:58 log: LSP Error: at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) 2019/10/25 13:56:58 log: LSP Error: at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) 2019/10/25 13:56:58 log: LSP Error: at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) 2019/10/25 13:56:58 log: LSP Error: at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566) 2019/10/25 13:56:58 log: LSP Error: at org.javacs.kt.SourceFilesKt.findSourceFiles(SourceFiles.kt:213) 2019/10/25 13:56:58 log: LSP Error: at org.javacs.kt.SourceFilesKt.access$findSourceFiles(SourceFiles.kt:1) 2019/10/25 13:56:58 log: LSP Error: at org.javacs.kt.SourceFiles.addWorkspaceRoot(SourceFiles.kt:145) 2019/10/25 13:56:58 log: LSP Error: at org.javacs.kt.KotlinLanguageServer.initialize(KotlinLanguageServer.kt:75) 2019/10/25 13:56:58 log: LSP Error: ... 16 more 2019/10/25 13:56:58 : DidChange: unknown language server for URI "file:///Users/ilanpillemer/Repos/bxbdigital/model-language/src/main/kotlin/DslInterpreter.kt" 2019/10/25 13:56:59 log: LSP Error: client Internal error: java.lang.reflect.InvocationTargetException 2019/10/25 13:56:59 log: LSP Error: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException 2019/10/25 13:56:59 log: LSP Error: at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:67) 2019/10/25 13:56:59 log: LSP Error: at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.request(GenericEndpoint.java:120) 2019/10/25 13:56:59 log: LSP Error: at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleRequest(RemoteEndpoint.java:261) 2019/10/25 13:56:59 log: LSP Error: at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:190) 2019/10/25 13:56:59 log: LSP Error: at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:192) 2019/10/25 13:56:59 log: LSP Error: at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94) 2019/10/25 13:56:59 log: LSP Error: at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113) 2019/10/25 13:56:59 log: LSP Error: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 2019/10/25 13:56:59 log: LSP Error: at java.util.concurrent.FutureTask.run(FutureTask.java:266) 2019/10/25 13:56:59 log: LSP Error: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 2019/10/25 13:56:59 log: LSP Error: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 2019/10/25 13:56:59 log: LSP Error: at java.lang.Thread.run(Thread.java:748) 2019/10/25 13:56:59 log: LSP Error: Caused by: java.lang.reflect.InvocationTargetException 2019/10/25 13:56:59 log: LSP Error: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2019/10/25 13:56:59 log: LSP Error: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 2019/10/25 13:56:59 log: LSP Error: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 2019/10/25 13:56:59 log: LSP Error: at java.lang.reflect.Method.invoke(Method.java:498) 2019/10/25 13:56:59 log: LSP Error: at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:65) 2019/10/25 13:56:59 log: LSP Error: ... 11 more 2019/10/25 13:56:59 log: LSP Error: Caused by: java.lang.NullPointerException 2019/10/25 13:56:59 log: LSP Error: at sun.nio.fs.UnixFileSystem$3.matches(UnixFileSystem.java:310) 2019/10/25 13:56:59 log: LSP Error: at org.javacs.kt.SourceFilesKt$findSourceFiles$1.test(SourceFiles.kt:212) 2019/10/25 13:56:59 log: LSP Error: at org.javacs.kt.SourceFilesKt$findSourceFiles$1.test(SourceFiles.kt) 2019/10/25 13:56:59 log: LSP Error: at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:174) 2019/10/25 13:56:59 log: LSP Error: at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) 2019/10/25 13:56:59 log: LSP Error: at java.util.Iterator.forEachRemaining(Iterator.java:116) 2019/10/25 13:56:59 log: LSP Error: at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801) 2019/10/25 13:56:59 log: LSP Error: at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) 2019/10/25 13:56:59 log: LSP Error: at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) 2019/10/25 13:56:59 log: LSP Error: at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) 2019/10/25 13:56:59 log: LSP Error: at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) 2019/10/25 13:56:59 log: LSP Error: at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566) 2019/10/25 13:56:59 log: LSP Error: at org.javacs.kt.SourceFilesKt.findSourceFiles(SourceFiles.kt:213) 2019/10/25 13:56:59 log: LSP Error: at org.javacs.kt.SourceFilesKt.access$findSourceFiles(SourceFiles.kt:1) 2019/10/25 13:56:59 log: LSP Error: at org.javacs.kt.SourceFiles.addWorkspaceRoot(SourceFiles.kt:145) 2019/10/25 13:56:59 log: LSP Error: at org.javacs.kt.KotlinLanguageServer.initialize(KotlinLanguageServer.kt:75) 2019/10/25 13:56:59 log: LSP Error: ... 16 more

Lassist is awesome but not mentioned in README

I really love Lassist and how it updates its own window as you type to provide context relevant information... but I only discovered it accidentally. Perhaps its existence should be mentioned in the README?

Add support for Plan 9 acme

acme-lsp should be made to work on Plan 9 (or 9front). Currently, it doesn't work because of 9fans.net/go packages and because we use unix domain sockets.

Chording the commands doesn't work

I'd like to keep my L* commands in a guide file and 2-1 chord to invoke them.
But using $winid to find the command context returns the window containing the command, not the target.
Instead, it should likely use the chordorigin parameter of the acme message.

Organize Imports code action is not working for gopls >= v0.3.1

Since I upgraded to macOS Catalina on "Put" the import path will not be organised any more (added/removed). Only the compiler will complain and write to /LSP/Diagnostics:

 /Users/m/Documents/src/project/project.go:88:14-88:26: undeclared name: strings

I tried to run acme-lsp -v but I do not get any error message or logs displayed on "Put". Any suggestions?

My config looks a follows:

WorkspaceDirectories = [
	"/Users/m/Documents/src/project",
]
FormatOnPut = true
CodeActionsOnPut = ["source.organizeImports"]

[Servers]
	[Servers.gopls]
	Command = ["gopls", "serve", "-rpc.trace"]
	StderrFile = "gopls.stderr.log"
	LogFile = "gopls.log"

		# These settings gets passed to gopls
		[Servers.gopls.Options]
		hoverKind = "FullDocumentation"

[[FilenameHandlers]]
Pattern = '([/\\]go\.mod)|([/\\]go\.sum)|(\.go)$'
ServerKey = "gopls"

Support for code action for diagnostics is missing

LSP provides a way of applying fix for diagnostics automatically. User selects a suggested fix (code action) for a diagnostic, and then LSP server sends the edits we need to apply to fix it.

Right now we manually apply the source.organizeImports code action (goimports for Go) every time we format a file, but we should support other code actions triggered from a diagnostic (e.g. quickfix).

Main challenge of implementing this would be figuring out a good UI.

feature: force ignore directory, or respect underscore convention?

Hi,

In an existing github project where I contribute (https://github.com/containous/yaegi), they have a "_test" directory at the root, containing .go files, each of them being a main package.
I know they're not supposed to have more than one main in a directory, but on the other hand, since the directory starts with an underscore, it is ignored by the go tool ('go test ./...' at the root runs fine), as I think is the convention.

The reason I'm bringing this up, is because it seems acme-lsp chokes on that structure. If I add the project with L ws+, most things work fine with the L commands. However, as soon as I open in acme one of the files in the _test dir, acme-lsp seems to enter an infinite loop and burning CPU, spewing errors in /LSP/Diagnostics forever.

So don't you think acme-lsp should ignore any file or directory starting with an underscore, as the go tool does? Or if not, could we have a configuration option that tells it to ignore a specific directory? If not, can you think of any other work-around I could use?

I was thinking that in the meantime maybe I could add build tags to all of the files in the _test directory, but I'm not sure that would do the trick, I haven't tried yet.

Add support for didChangeConfiguration notification

Currently, we can configure LSP servers through the acme-lsp config file, but LSP also supports changing configuration dynamically through the didChangeConfiguration notification. We should add a L sub-command for it.

Support for this was added to gopls recently. This can be used to change Go build tags dynamically.

scala metals (lsp) - dynamic root directory

Following the instructions in https://scalameta.org/metals/docs/editors/new-editor.html, I have installed metals.

This language server uses the RootUri (RootDirectory in acme-lsp config) as the project starting point, supporting the addition of workspaces using the lsp messages.

I'm not sure if this is a common practice. This server works with multiple editor (vscode, emacs, vim, etc.). If it is, having a way to specify RootDirectory from cli instead the config file could come handy for acme-lsp.

rust/rls support

As anyone been able to make it work with rls?
I am not giving any details as I am running acme-lsp and rls in a very strange way (using my https://github.com/perpen/lx), but I would like to know if the problem is due to my unorthodox setup, or to some incompatibility between acme-lsp and rls.

question: output location of L refs

At the moment the output of "L refs" appears in the terminal where I've started acme-lsp. I would expect it to be somewhere in acme, so I can interact with it directly (maybe in /LSP/Diagnostics ?), or maybe even directly sent to the plumber.
Am I missing something, or did I misconfigure something? or is it behaving as expected?

Multiple language id, file extension pairs support (trying ocamllsp)

Hello

I am trying the ocaml-lsp server (https://github.com/ocaml/ocaml-lsp) and it requires a combination of file-extension / languageId parameters which I am unable to set up using acme-lsp.

I guess DetectLanguage is only prepared for golang and python, and it might work if the file extension is the same as the language id in the language server you're using. I've tried scala metals in the past and it worked, probably because of this.

Seems that making the obvious change to the function DetectLanguage gets the ocaml-lsp server working.

Adding a language id parameter in acme-lsp would come handy to support more languages.

This server supports multiple languages a the same time like ReasonML and Ocaml. My guess is that each time one is opened in an editor, the apropriate extension/langId is generated.

Something like:

$ acme-lsp -lang ml:ocaml -lang rml:reasonml -lang ...

could work. What do you think?

gabi

clojure-lsp unmarshalling json error

Running on Mac OS X 10.15.2 with Plan 9 User Space and clojure-lsp
L hov - worked great
But
L comp, L def and L fmt all show the following in the terminal that is running acme-lsp -v
2019/12/28 17:16:52 Format failed in file manager: unmarshalling result: json: cannot unmarshal string into Go struct field CodeAction.command of type protocol.Command
The two log files that I configured in the .toml file have no contents. Here is my config file:

ProxyNetwork = "unix"
ProxyAddress = "/tmp/ns.ses.:0/acme-lsp.rpc"
AcmeNetwork = "unix"
AcmeAddress = "/tmp/ns.ses:0/acme"
WorkspaceDirectories = ["/Users/ses/Projects/Clojure/fiat-hell"]
RootDirectory = "/Users/ses/Projects/Clojure"
FormatOnPut = true
CodeActionsOnPut = ["source.organizeImports"]

[Servers]
  [Servers.clojure]
    Command = ["sh", "-c", "cd /Users/ses/Projects/Clojure;clojure-lsp"]
    Address = ""
    StderrFile = "/Users/ses/Library/Caches/acme-lsp/clojure.stderr.log"
    LogFile = "/Users/ses/Library/Caches/acme-lsp/clojure.log"
    [Servers.clojure.Options]

[[FilenameHandlers]]
  Pattern = "(\\.deps)|(\\.clj)$"
  ServerKey = "clojure"

question: disable diagnostics window?

Hello,

At the moment, the diagnostics window generates so many "false positives" that it has become completely useless to me. It's usually a wall of text where actually relevant errors are near-impossible to find. I don't know if it is a misconfiguration on my part, or incompatibilities with the project(s) I am working on, or a shortcoming of acme-lsp, but that's how it is for me.

Not only is it sad that it does not do anything useful for me anymore, but the actual problem is it has also become a nuisance because whenever I do Put on a window, the diagnostics window refreshes, and sometimes the mouse pointer even jumps to it.

I would like to keep on using acme-lsp, for "L def", and automatic formatting + imports, but I would like to get rid of the diagnostics window for now. Is it possible?

thanks.

acmefocused not working

I followed the usage present in the acmefocused page but every time I do dial $(namespace)/acmefocused it returns this:
dial: dial: malformed address
As far as I know, this is the same message that happens when you insert an address that doesn't exist, but if I cd into it with cd $(namespace) and do a ls, acmefocused does appear:

srwxr-xr-x 0 artur 31 Dec 10:17 acme
srwxr-xr-x 0 artur 31 Dec 10:17 acmefocused
srwxr-xr-x 0 artur 31 Dec 09:39 font
srwxr-xr-x 0 artur 31 Dec 09:40 plumb

If I'm doing something wrong, I ask you for clarification...

Always insert first suggestion in L comp -e

When using L comp -e, if there is more than one match for the pattern under the cursor, the matches are printed out. It'd be nice to have the first match inserted and selected so that it can be easily removed again.

I'd find this useful especially for Go code using generated protobuf packages, because those often have multiple matches for patterns where the first match is almost always the right thing since the generated code contains a GetFoo function for every field Foo, so that running L comp -e on

x := foo.bar|

(with | being the cursor position)

yields suggestions like

Something.Bar string
GetSomething().Bar string

Does this make sense? If so, I think I can prepare a PR.

Use persistent LSP servers

Right now lsp server is executed for (almost) every sub-command of L. We want to have one instance of lsp server running and have all the sub-commands query it. This will take advantage of any caches used by lsp servers, and most likely result in faster responses.

Details of the implementation is not clear to me at the moment. We may be able to use the plumber. For exmaple: plumb -d lsp -a 'winid=42' definition would ask the acme-lsp server to show the definition of the identifier selected in window 42. This does require us to open up a port in the plumber, similar to seemail and showmail.

The other option I see is to implement a 9p fileserver, where we can run echo definition 42 | 9p write lsp/ctl to achieve the same thing. We may have files like lsp/servers for list of LSP servers, and lsp/workspaces for list of workspace directories (required for gopls). This option is more flexible, doesn't require adding a plumber rule, but requires a bit more work to implement.

formatOnPut behaving erratically

As it is difficult to explain the behavior, and I do not have reliable instruction for a repro yet, here is a video demonstrating the behavior for now:

https://granivo.re/tmp/acme_lsp_fmt-2020-02-28_10.45.46.mov

One systematic aspect of the bug though, is the file(s) for which it happens: i.e. I haven't been able to make it not happen for a file where I observe the buggy behavior, and vice-versa.

acme-lsp: c143b86
golang.org/x/tools/gopls v0.3.2 h1:eP1aj1AvT6ynElQH6KP0mmOT2gnWa1gYclHL4wGUbMo=

As requested by @fhs , I will provide the gopls rpc trace when I have it.

automatic imports on formatting not working

when using the latest gopls and latest acme-lsp the automatic importing of go modules breaks

this is probably caused by a change in the gopls protocol, i tried several older version too (about 0.12 - 0.14) but it sill was broken

golang.org/x/tools/gopls v0.14.0
go version go1.21.3 linux/amd64

i traced the error to the CompatibleCodeActions function in internal/lsp/utils.go
and implemented a very very quick and dirty fix to remedy the issue.
kmx1@dea92a6
the type switch never got into the case protocol.CodeActionOptions

although it should probably be fixed in the protocol package? if that is even the cause

but maybe this should be done by someone who has a more thorough understanding of the LSP protocol and gopls

i hope that helps and thank you for this project

acme-lsp doesn't play well with editinacme

When acme-lsp is running, editinacme does not appear to work properly. (It also relies on the use of editor events.) Editinacme can successfully launch editor windows, but does not detect window delete events until after acme-lsp is killed. I haven't had the time to look into it yet, but it may be that acme-lsp is blocking propagation of those events in some way.

Config not read

Greetings,
How should I find out why the config file is not read?
It is such a basic thing that it is unlikely to be acme-lsp that is at fault.
However, how do I find out what I am doing wrong?

$ acme-lsp  
2022/02/06 14:20:13 no servers found in the configuration file or command line flags

$ acme-lsp -showconfig
# Configuration file location: /home/bengt/.config/acme-lsp/config.toml

ProxyNetwork = "unix"
ProxyAddress = "/tmp/ns.bengt.:0/acme-lsp.rpc"
AcmeNetwork = "unix"
AcmeAddress = "/tmp/ns.bengt.:0/acme"
RootDirectory = "/"
HideDiagnostics = false
FormatOnPut = true
RPCTrace = false
FilenameHandlers = []

[Servers]
  [Servers.gopls]
    Command = ["gopls", "serve", "-rpc.trace"]
    Address = ""
    StderrFile = "/home/bengt/.cache/acme-lsp/gopls.stderr.log"
    LogFile = "/home/bengt/.cache/acme-lsp/gopls.log"
    [Servers.gopls.Options]
      hoverKind = "FullDocumentation"

Config file (renamed to work with attaching file, it is called config.toml)
config.txt

Add support for acme dump file

acme-lsp should make use of the dump ctl message to set the command to restart acme-lsp from a dump file.

It's not clear whether we should keep a persistent window open for dumping purposes, or "/LSP/Diagnostics" window should become persistent, or something else.

Watch for changed files

When files are changed outside of acme (e.g. git branch change), gopls currently doesn't update its cache. We should implement workspace/didChangeWatchedFiles when gopls supports it (issue golang/go#31553).

We may want to have a temporary workaround for gopls. Perhaps just watch for all matching (.go) files in the workspaces?

error on startup


2023/01/01 14:02:52 failed to create file manager: failed to connect to language server ["gopls" "serve" "-rpc.trace" "--debug=localhost:6060"]: initialize failed: unmarshalling result: json: cannot unmarshal object into Go struct field ServerCapabilities.capabilities.selectionRangeProvider of type boo

seems probably linked to this line of code

internal/lsp/acmelsp/client.go:166:		return fmt.Errorf("initialize failed: %v", err)
	params := &protocol.InitializeParams{
		RootURI: text.ToURI(d),
		Capabilities: protocol.ClientCapabilities{
			// Workspace: ..., (struct literal)
			TextDocument: protocol.TextDocumentClientCapabilities{
				CodeAction: &protocol.CodeActionClientCapabilities{
					CodeActionLiteralSupport: &protocol.CodeActionLiteralSupport{
						// CodeActionKind: ..., (struct literal)
					},
				},
				DocumentSymbol: &protocol.DocumentSymbolClientCapabilities{
					HierarchicalDocumentSymbolSupport: true,
				},
			},
		},
		WorkspaceFolders:      cfg.Workspaces,
		InitializationOptions: cfg.Options,
	}
	params.Capabilities.Workspace.WorkspaceFolders = true
	params.Capabilities.Workspace.ApplyEdit = true
	params.Capabilities.TextDocument.CodeAction.CodeActionLiteralSupport.CodeActionKind.ValueSet =
		[]protocol.CodeActionKind{protocol.SourceOrganizeImports}
	var result protocol.InitializeResult
	if err := rpc.Call(ctx, "initialize", params, &result); err != nil {
		return fmt.Errorf("initialize failed: %v", err)
	}
	if err := rpc.Notify(ctx, "initialized", &protocol.InitializedParams{}); err != nil {
		return fmt.Errorf("initialized failed: %v", err)
	}
	c.Server = server
	c.initializeResult = &result
	return nil

So error is being returned I assume from gopls, I will look there now and see if I can see what changed there.

look like its linked to this commit in gopls

golang/tools@1270fd7

and

golang/go#36679

Upon analysis the error is because the go server is expecting a struct and not a bool.. see golang/tools@1270fd7

I have made a PR to match this expectation (my local testing in acme was successful)

NB: started happening during last week of December.

In internal/lsp/text/edit.go, ToPath doesn't percent decode input URI

Here's an example.

On my machine, C++'s std::deque is located at this path:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/deque

I tried doing "L def" on std::deque.

Since the path contains ++ ("c++"), when it got to Acme, it was interpreted as this filename:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c%2B%2B/v1/deque

Notice percent encoded %2B%2B.

Since this file doesn't exist, this error is printed:

can't open /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c%2B%2B/v1/deque: No such file or directory

Correctly handle UTF-16 offsets

LSP uses UTF-16 offsets:

A position inside a document (see Position definition below) is expressed as a zero-based line and character offset. The offsets are based on a UTF-16 string representation. So a string of the form a𐐀b the character offset of the character a is 0, the character offset of 𐐀 is 1 and the character offset of b is 3 since 𐐀 is represented using two code units in UTF-16.

Acme uses rune offsets. Currently, we treat the UTF-16 offsets as rune offsets (and vice versa) for an easier implementation, which is obviously wrong.

Relative file paths in assists / diagnostics

It would be a bit more readable if file paths in the diagnostics window where relative to the workspace. I think this should be possible, either by doing some magic in the Win or setting the base path of the L win to the workspace.

It would be nice if you can specify the config file location

On Darwin the config gets put in "Application Support".. Because of the space in the directory name I am having trouble editing this file in Acme, and have to use Emacs. If I could specify where this file is located somehow (maybe an environment variable) that would be great.

Even better would be just to use a .acme-lsp.toml file in ~ if it exists.

Currently it does this :
// On Darwin, it returns $HOME/Library/Application Support.

L hov panic when used on primitive types with typescript-language-server

Env

Client version: 9fans.net/[email protected]
Typescript LSP version: 4.3.3
Plan9Port version: 9fans/plan9port@be7c68f

L hov works fine on variables, functions, complex types and type aliases, but if I try to use it on a literal value or on
a primitive type, it fails.

Code example

type A = string

const a: A = "a string"

const b: A[] = [a, a ,a]

What happens for each symbol

hov on type

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x57afd1]

goroutine 1 [running]:
9fans.net/acme-lsp/internal/lsp/acmelsp.(*RemoteCmd).Hover(0xc000165eb0, {0x630f78, 0x7839e0})
	/home/patrick/go/pkg/mod/9fans.net/[email protected]/internal/lsp/acmelsp/remote.go:197 +0xb1
main.run(0xc000000180, {0xc000016050, 0x1, 0x1})
	/home/patrick/go/pkg/mod/9fans.net/[email protected]/cmd/L/main.go:230 +0xbcb
main.main()
	/home/patrick/go/pkg/mod/9fans.net/[email protected]/cmd/L/main.go:117 +0x65
L: exit 2

hov on A

type A = string

hov on string

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x57afd1]

goroutine 1 [running]:
9fans.net/acme-lsp/internal/lsp/acmelsp.(*RemoteCmd).Hover(0xc000165eb0, {0x630f78, 0x7839e0})
	/home/patrick/go/pkg/mod/9fans.net/[email protected]/internal/lsp/acmelsp/remote.go:197 +0xb1
main.run(0xc000000180, {0xc000016050, 0x1, 0x1})
	/home/patrick/go/pkg/mod/9fans.net/[email protected]/cmd/L/main.go:230 +0xbcb
main.main()
	/home/patrick/go/pkg/mod/9fans.net/[email protected]/cmd/L/main.go:117 +0x65
L: exit 2
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x57afd1]

hov on const

goroutine 1 [running]:
L: exit 2
9fans.net/acme-lsp/internal/lsp/acmelsp.(*RemoteCmd).Hover(0xc000151eb0, {0x630f78, 0x7839e0})
	/home/patrick/go/pkg/mod/9fans.net/[email protected]/internal/lsp/acmelsp/remote.go:197 +0xb1
main.run(0xc000000180, {0xc000016050, 0x1, 0x1})
	/home/patrick/go/pkg/mod/9fans.net/[email protected]/cmd/L/main.go:230 +0xbcb
main.main()
	/home/patrick/go/pkg/mod/9fans.net/[email protected]/cmd/L/main.go:117 +0x65

hov on a

const a: string

hov on "a string"

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x57afd1]

goroutine 1 [running]:
9fans.net/acme-lsp/internal/lsp/acmelsp.(*RemoteCmd).Hover(0xc000165eb0, {0x630f78, 0x7839e0})
	/home/patrick/go/pkg/mod/9fans.net/[email protected]/internal/lsp/acmelsp/remote.go:197 +0xb1
main.run(L: exit 2
0xc000000180, {0xc000016050, 0x1, 0x1})
	/home/patrick/go/pkg/mod/9fans.net/[email protected]/cmd/L/main.go:230 +0xbcb
main.main()
	/home/patrick/go/pkg/mod/9fans.net/[email protected]/cmd/L/main.go:117 +0x65

hov on b

const b: string[]

hov while selecting the chars A[]

type A = string

hov with cursor at begining of [a,a,a]

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x57afd1]

goroutine 1 [running]:
9fans.net/acme-lsp/internal/lsp/acmelsp.(*RemoteCmd).Hover(0xc0001a5eb0, {0x630f78, 0x7839e0})
	/home/patrick/go/pkg/mod/9fans.net/[email protected]/internal/lsp/acmelsp/remote.go:197 +0xb1
main.run(0xc000000180, {0xc000016050, 0x1, 0x1})
	/home/patrick/go/pkg/mod/9fans.net/[email protected]/cmd/L/main.go:230 +0xbcb
main.main()
	/home/patrick/go/pkg/mod/9fans.net/[email protected]/cmd/L/main.go:117 +0x65
L: exit 2

hov on any a inside the [a,a,a]

type A = string

Restart LSP server if it's killed

Some LSP servers (e.g.gopls) sometimes gets into a bad state after a while because of bugs. If the user kills the server with a signal, we should restart it (and properly redo initialization).

Note: apparently VScode does this.

Cant get vue language server to work

Cant get @vue/language-server to work.

I installed it with yarn global add @vue/language-server then wrote this script:

#!/bin/bash

vue-language-server --stdio

My server entry looks like this:

	[Servers.vueServer]
	Command = ["bash", "-c", "/home/patrick/bin/vueLSP.sh"]
	StderrFile = "vueServer.stderr.log"
	LogFile = "vueServer.log"

I always get the following error: 2023/11/20 11:06:48 failed to create file manager: failed to connect to language server ["bash" "-c" "/home/patrick/bin/vueLSP.sh"]: initialize failed: jsonrpc2: code -32603 message: Request initialize failed with message: Cannot read properties of undefined (reading 'cancellationPipeName')

The log files are empty.

As I reminder of my last issue, I was able to get the standard typescript compiler to work just fine.

Error starting clojure-lsp

Trying to start up acme-lsp with a config.toml file that is specifying the clojure-lsp server. Running on Mac OS X 10.15.2

My PATH contains the location of clojure-lsp. Typing clojure.lsp in the shell runs it successfully. I have used this lsp server with VSCode and Neovim successfully.

The error I am getting is:
failed to create file manager: failed to execute language server: fork/exec /usr/local/clojure-lsp/clojure-lsp: exec format error

That is the correct location to clojure-lsp. There are no log messages in the LogFile or StderrFile or the clojure-lsp log.

Config is:
`ProxyNetwork = "unix"
ProxyAddress = "/tmp/ns.ses.:0/acme-lsp.rpc"
AcmeNetwork = "unix"
AcmeAddress = "/tmp/ns.ses.:0/acme"
WorkspaceDirectories = ["/Users/ses/Projects/Clojure/finance"]
RootDirectory = "/"
FormatOnPut = true
CodeActionsOnPut = ["source.organizeImports"]

[Servers]
[Servers.clojure]
Command = ["clojure-lsp"]
Address = ""
StderrFile = "/Users/ses/Library/Caches/acme-lsp/clojure.stderr.log"
LogFile = "/Users/ses/Library/Caches/acme-lsp/clojure.log"
[Servers.clojure.Options]
hoverKind = "FullDocumentation"

[[FilenameHandlers]]
Pattern = "(\.deps)|(\.clj)$"
ServerKey = "clojure"`

acme-lsp crashes the latest gopls

I've filed an issue in the the golang tracker with details. For now, recommend using gopls at hte prior commit:

$ GO111MODULE=on go get golang.org/x/tools/cmd/gopls@238129aa638afb6cf8cf56a290487ddd93c2fad7

Add support for dynamic workspace folder changes

Support for it has been added to gopls: golang/tools@80b1e87.
This will enable users to change the workspace directories without restarting acme-lsp.

In the future, we may want to automatically add missing workspace directories for certain languages (e.g. Go) that requires them, but that's outside the scope of this issue.

Write diagnostics to a dedicated window

The textDocument/publishDiagnostics notification document says:

When a file changes it is the server’s responsibility to re-compute diagnostics and push them to the client. If the computed set is empty it has to push the empty array to clear former diagnostics. Newly pushed diagnostics always replace previously pushed diagnostics. There is no merging that happens on the client side.

Instated of printing diagnostics to stdout, we should print them to a dedicated acme window (let's say named /LSP/Diagnostics). This will make it easier to spot the latest diagnostics after a Put.

win sub-command: show help based on cursor position

Currently the win sub-command can execute completion, hover or signature help based on current cursor position. The idea is to automatically choose between the 3 commands based on the content of the selection and the surround text without assuming the programming language.

Some ideas:

  • Define a regex for identifier which works for most programming languages
  • If cursor is within identifier, show hover
  • If cursor is within whitespace, don't change what we're showing
  • If left of cursor is (, [, <, or {, show signature help
  • Otherwise show completion

question: support for projects without a go.mod?

As per the README: "where mod1 and mod2 are module directories with a go.mod file."
Does this mean that L won't ever support projects without a go.mod and/or with GO111MODULE=off ?
If yes, is that due to a limitation of gopls?

P.S: I've just had a quick try and already found what I think are two obvious problems, but not sure I should open issues as you probably are already aware of them:

  1. apparently the argument to -workspaces needs to be an absolute path. I've tried with a (valid) relative path, and things didn't seem to work.
  2. 'L def' seems to result in an address like /some/path:line:column , which does not seem to open. If I remove the :column , it works. Or maybe I'm missing some plumb rules that are not by default in p9p acme?

Let me know if you want me to open issues for the above.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.