Giter Site home page Giter Site logo

go-language-server's People

Contributors

abarisain avatar avelino avatar bredov avatar codmajik avatar egamma avatar f0zi avatar goenning avatar ironcladlou avatar jankoehnlein avatar kieferrm avatar kode4food avatar leaxoy avatar lukehoban avatar mattetti avatar netroby avatar newhook avatar nwolber avatar rafax avatar ramya-rao-a avatar roblourens avatar sijad avatar slomek avatar svenefftinge avatar tampajohn avatar thesoenke avatar thomasdarimont avatar tylerb avatar uudashr avatar yuntan avatar zippoxer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

go-language-server's Issues

Unclear error when go binary is not found

When trying to use the server, I got this error:

server --> client: b'{"jsonrpc":"2.0","method":"window/logMessage","params":{"type":1,"message":"[lspserver] (node:17641) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 3): TypeError: \\"file\\" argument must be a non-empty string"}}'
server --> client: b'{"jsonrpc":"2.0","method":"window/logMessage","params":{"type":1,"message":"[lspserver] (node:17641) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code."}}'

and the server wouldn't reply anything. After some debugging, I found that it was because it didn't find the go binary. The rejected promise should be handled to avoid that warning, and a better error message should be given to the user to indicate what to fix.

textDefinition on some comments returns an error

This situation can happen if you hold ctrl down and hover some words in comments with your cursor.

client --> server: {"id": 124, "jsonrpc": "2.0", "method": "textDocument/definition", "params": {"textDocument": {"uri": "file:///home/emaisin/src/ls-interact/go-test/test.go"}, "position": {"character": 46, "line": 12}}}
server --> client: {"jsonrpc":"2.0","id":124,"error":{"code":-32600,"message":"Command failed: /home/emaisin/gopath/bin/godef -t -i -f /home/emaisin/src/ls-interact/go-test/test.go -o 334\ngodef: no identifier found\n","data":"Command failed: /home/emaisin/gopath/bin/godef -t -i -f /home/emaisin/src/ls-interact/go-test/test.go -o 334\ngodef: no identifier found\n"}}

In Theia, this results in an annoying error popup. If you move all over the comments with your cursor while holding ctrl, you'll get many error popups.

It can be reproduced when using this code there (test.go): https://github.com/simark/ls-interact/tree/master/go-test, and hovering the word "that" on line 13.

Can't open some .go files

Something like this was reported by our internal users, but it's the first time I witness it myself. See attached video.

I was using the theiaide/theia-go image (https://hub.docker.com/r/theiaide/theia-go/), pulled fresh today. In it, I cloned the golang repo (https://github.com/golang/go.git) and noticed I could not open file src/bufio/bufio_test.go . However I am able to open other .go files in the same directory. The file itself looks fine; I can "cat" it successfully.

This may not consistently reproducable (it works for me using a different, internal docker image, that also has golang LS).

Here's the exception:

Uncaught (in promise) A resource provider for 'file:///home/theia/go/src/bufio/bufio_test.go' is not registered.
rejected @ opener-service.ts:6
Promise.then (async)
step @ opener-service.ts:6
fulfilled @ opener-service.ts:6
Promise.then (async)
step @ opener-service.ts:6
(anonymous) @ opener-service.ts:6
__awaiter @ opener-service.ts:6
open @ opener-service.ts:71
FileNavigatorModel.doOpenNode @ navigator-model.ts:32
TreeModel.openNode @ tree-model.ts:238
TreeWidget.handleDblClickEvent @ tree-widget.ts:280
ondblclick @ tree-widget.ts:131

peek 2018-02-01 08-01

Make outputChannel work

A lot of valuable output goes into the output channel of the VSCode extension.
We should implement something similar for Theia and then route the outputChannel there.
Maybe related to eclipse-theia/theia#786

Make code lens work

Code lens works fine apart from opening the references:

The server composes a set of arguments of type URI, Position and Location[] for the editor.action.showReferences command (in goReferencesCodelens#resolveCodeLens). These are sent to the client, as such converted to plain JSON objects. The client, when trying to execute the command, validates the args to be instance of URI, IPosition and Array, which fails as they are plain JSON objects.

One solution could be to register a separate command in the theia-go-extension that is called instead and does the conversion.

Add build instructions in the README

Would it be possible to indicate in the README how to build this package? Also, maybe how to run the tests? My guess was npm run compile and npm run test, but I get:

 Error: ENOENT: no such file or directory, open '/home/emaisin/.go/go.json'
    at Object.fs.openSync (fs.js:653:18)
    at Object.fs.readFileSync (fs.js:554:33)
    at new FileBasedConfig (/home/emaisin/src/go-language-server/out/src-vscode-mock/config.js:14:37)
    at WorkspacConfigurationProvider.getConfig (/home/emaisin/src/go-language-server/out/src-vscode-mock/workspace.js:83:28)
    at WorkspacConfigurationProvider.get (/home/emaisin/src/go-language-server/out/src-vscode-mock/workspace.js:64:68)
    at Workspace.getConfiguration (/home/emaisin/src/go-language-server/out/src-vscode-mock/workspace.js:105:52)
    at Object.<anonymous> (/home/emaisin/src/go-language-server/out/src-vscode-mock/lsp-server.spec.js:93:24)
    at Generator.next (<anonymous>)
    at /home/emaisin/src/go-language-server/out/src-vscode-mock/lsp-server.spec.js:13:71
    at new Promise (<anonymous>)
    at __awaiter (/home/emaisin/src/go-language-server/out/src-vscode-mock/lsp-server.spec.js:9:12)
    at Context.before (/home/emaisin/src/go-language-server/out/src-vscode-mock/lsp-server.spec.js:50:14)
    at callFn (/home/emaisin/src/go-language-server/node_modules/mocha/lib/runnable.js:348:21)
    at Hook.Runnable.run (/home/emaisin/src/go-language-server/node_modules/mocha/lib/runnable.js:340:7)
    at next (/home/emaisin/src/go-language-server/node_modules/mocha/lib/runner.js:309:10)
    at Immediate.<anonymous> (/home/emaisin/src/go-language-server/node_modules/mocha/lib/runner.js:339:5)
    at runCallback (timers.js:785:20)
    at tryOnImmediate (timers.js:747:5)
    at processImmediate [as _immediateCallback] (timers.js:718:5)
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/home/emaisin/.go/go.json' }
  default config

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.