Code Monkey home page Code Monkey logo

Comments (5)

fhs avatar fhs commented on September 27, 2024 1

I can reproduce the issue with gopls v0.3.1 and v0.3.2. Imports code action is not working because gopls changed the response format to versioned document edits. acme-lsp does not advertise to support versioned document edits, but gopls uses the new format anyway. These kinds of breakage are probably expected until gopls 1.0 is release.

Before (not versioned edit):

[Trace - 10:23:53.697 AM] Received response 'textDocument/codeAction - (2)' in 122ms.
Result: [{"title":"Organize Imports","kind":"source.organizeImports","edit":{"changes":{"file:///tmp/hello/hello.go":[{"range":{"start":{"line":8,"character":0},"end":{"line":8,"character":0}},"newText":"\t\"fmt\"\n"}]}}}]

After (versioned document edit):

[Trace - 10:13:42.788 AM] Received response 'textDocument/codeAction - (2)' in 15ms.
Result: [{"title":"Organize Imports","kind":"source.organizeImports","edit":{"documentChanges":[{"textDocument":{"version":0,"uri":"file:///tmp/hello/hello.go"},"edits":[{"range":{"start":{"line":8,"character":0},"end":{"line":8,"character":0}},"newText":"\t\"fmt\"\n"}]}]}}]

from acme-lsp.

mpl avatar mpl commented on September 27, 2024

Are you sure it has to do with Catalina?
I recently experienced similar problems (and others), but it was after I updated gopls and/or acme-lsp.
I reverted to f9edabb for acme-lsp and 0.2.2 for gopls and everything was fine again. And I am on Catalina as well.
Sorry @fhs , I didn't have time to investigate/report at the time, which is why I reverted straight away.

from acme-lsp.

palmamartin avatar palmamartin commented on September 27, 2024

No I'm not sure. It only occurred to me after I upgrade to Catalina, but it can be that after the upgrade I updated/reinstalled acme-lsp to the latest version.

I just downgraded acme-lsp to v0.9.0 (f9edabb) and gopls to 0.2.2 and now it is working again.

from acme-lsp.

fhs avatar fhs commented on September 27, 2024

Check if gopls works without acme-lsp by running:

gopls check project.go

There is also gopls imports sub-command.

from acme-lsp.

palmamartin avatar palmamartin commented on September 27, 2024

With the latest gopls, without acme-lsp, gopls check and gopls imports work as expected.

$ gopls version
golang.org/x/tools/gopls v0.3.1
    golang.org/x/tools/[email protected] h1:yNTWrf4gc4Or0UecjOas5pzOa3BL0WDDyKDV4Wz5VaM=

With acme-lsp version v0.9.0 and gopls v0.3.1 the check part works but the import part does not.

from acme-lsp.

Related Issues (20)

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.