Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LSP] Goto definition is getting response null #922

Closed
sswaroopgupta opened this issue Jan 18, 2018 · 4 comments
Closed

[LSP] Goto definition is getting response null #922

sswaroopgupta opened this issue Jan 18, 2018 · 4 comments
Labels

Comments

@sswaroopgupta
Copy link
Contributor

Expected behavior
Should get the response for the step.

Actual behavior
Getting the following response

19:54:01.024 --> request #0: initialize: {"processId":13660,"rootPath":"c:\\work\\getgauge\\gauge-lsp-tests\\data\\steps-gotodefinition","rootUri":"file:///c%3A/work/getgauge/gauge-lsp-tests/data/steps-gotodefinition","capabilities":{"workspace":{"applyEdit":true,"didChangeConfiguration":{"dynamicRegistration":true},"didChangeWatchedFiles":{"dynamicRegistration":true},"symbol":{"dynamicRegistration":true},"executeCommand":{"dynamicRegistration":true}},"textDocument":{"synchronization":{"dynamicRegistration":true,"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"dynamicRegistration":true,"completionItem":{"snippetSupport":true,"commitCharactersSupport":true}},"hover":{"dynamicRegistration":true},"signatureHelp":{"dynamicRegistration":true},"definition":{"dynamicRegistration":true},"references":{"dynamicRegistration":true},"documentHighlight":{"dynamicRegistration":true},"documentSymbol":{"dynamicRegistration":true},"codeAction":{"dynamicRegistration":true},"codeLens":{"dynamicRegistration":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true},"documentLink":{"dynamicRegistration":true}}},"trace":"off","experimental":{}}
19:54:01.027 <-- result #0: initialize: {"capabilities":{"textDocumentSync":1,"completionProvider":{"resolveProvider":true,"triggerCharacters":["*","* ","\"","\u003c",":",","]},"definitionProvider":true,"documentSymbolProvider":true,"workspaceSymbolProvider":true,"codeActionProvider":true,"codeLensProvider":{},"documentFormattingProvider":true,"renameProvider":true}}
19:54:01.034 --> notif: initialized: {}
19:54:01.040 --> notif: textDocument/didOpen: {"textDocument":{"uri":"file:///c%3A/work/getgauge/gauge-lsp-tests/data/steps-gotodefinition/specs/implementedStep.spec","languageId":"markdown","version":1,"text":"Go to definition of specification\r\n=================================\r\nA scenario\r\n-------------------------\r\n* step1\r\nAnother scenario\r\n-------------------------\r\n* step1\r\n* step1"}}
19:54:01.063 --> request #1: textDocument/definition: {"position":{"line":8,"character":4},"textDocument":{"uri":"file:///c%3A/work/getgauge/gauge-lsp-tests/data/steps-gotodefinition/specs/implementedStep.spec"}}
19:54:01.079 <-- result #1: textDocument/definition: null
19:54:01.092 <-- notif: textDocument/publishDiagnostics: {"uri":"file:///c%3A/work/getgauge/gauge-lsp-tests/data/steps-gotodefinition/specs/concept_definition.spec","diagnostics":[]}
19:54:01.093 <-- notif: textDocument/publishDiagnostics: {"uri":"file:///c%3A/work/getgauge/gauge-lsp-tests/data/steps-gotodefinition/specs/implementedStep.spec","diagnostics":[]}
19:54:02.624 <-- request #0: client/registerCapability: {"registrations":[{"id":"gauge-runner-didOpen","method":"textDocument/didOpen","registerOptions":{"documentSelector":{"scheme":"file","language":"javascript","pattern":"c:\\work\\getgauge\\gauge-lsp-tests\\data\\steps-gotodefinition/**/*"}}},{"id":"gauge-runner-didClose","method":"textDocument/didClose","registerOptions":{"documentSelector":{"scheme":"file","language":"javascript","pattern":"c:\\work\\getgauge\\gauge-lsp-tests\\data\\steps-gotodefinition/**/*"}}},{"id":"gauge-runner-didChange","method":"textDocument/didChange","registerOptions":{"documentSelector":{"scheme":"file","language":"javascript","pattern":"c:\\work\\getgauge\\gauge-lsp-tests\\data\\steps-gotodefinition/**/*"},"syncKind":1}},{"id":"gauge-runner-codelens","method":"textDocument/codeLens","registerOptions":{"documentSelector":{"scheme":"file","language":"javascript","pattern":"c:\\work\\getgauge\\gauge-lsp-tests\\data\\steps-gotodefinition/**/*"}}}]}
19:54:02.626 --> result #0: client/registerCapability: null
19:54:02.660 <-- notif: textDocument/publishDiagnostics: {"uri":"file:///c%3A/work/getgauge/gauge-lsp-tests/data/steps-gotodefinition/specs/concept_definition.spec","diagnostics":[{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":10000}},"severity":1,"code":"step(\"another scenario\", async function() {\n\tthrow 'Unimplemented Step';\n});","message":"Step implementation not found"},{"range":{"start":{"line":7,"character":0},"end":{"line":7,"character":10000}},"severity":1,"code":"step(\"undefined Concept\", async function() {\n\tthrow 'Unimplemented Step';\n});","message":"Step implementation not found"}]}
19:54:02.660 <-- notif: textDocument/publishDiagnostics: {"uri":"file:///c%3A/work/getgauge/gauge-lsp-tests/data/steps-gotodefinition/specs/implementedStep.spec","diagnostics":[]}

Steps to replicate

  • Run LSP tests gotodefinition\goto a step definition.spec

Version

Gauge version: 0.9.8.nightly-2018-01-16
Commit Hash: bd76268

Plugins
-------
js (2.1.1.nightly-2018-01-16)
@sswaroopgupta
Copy link
Contributor Author

Note
This test passes with Released Gauge version - gauge-0.9.7-windows.x86_64.exe and fails on 0.9.8.nightly-2018-01-16

@sswaroopgupta
Copy link
Contributor Author

Gauge should honour LSP protocol. I should be able to fire any request after initialized. However gotodefinition is not working as expected after initialized.

initialize
initialized
textDocument/publishDiagnostics
textDocument/didOpen
textDocument/definition

is giving error -

        Failed Step: goto definition of step "step1" in "/specs/implementedStep.spec" at "8" and "4" should give details "specs/gotodefinition/implementedStep"
        Specification: ...\gauge-lsp-tests\specs\gotodefinition\goto a step definition.spec:8
        Error Message: AssertionError [ERR_ASSERTION]: Response of a defined step should not be null
        Stacktrace: 
        AssertionError [ERR_ASSERTION]: Response of a defined step should not be null
            at Object.<anonymous> (...\gauge-lsp-tests\tests\gotodefinition.js:40:12)

Steps to replicate

  • LSP Tests

@riju91 riju91 self-assigned this Jan 29, 2018
@riju91 riju91 added in progress and removed ready labels Jan 29, 2018
@riju91
Copy link
Contributor

riju91 commented Jan 30, 2018

The plan of action of #921 will affect this as well

@riju91 riju91 added ready and removed in progress labels Jan 30, 2018
@riju91 riju91 removed their assignment Jan 30, 2018
@sswaroopgupta
Copy link
Contributor Author

With the latest working as expected

@ghost ghost removed the ready label Mar 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

4 participants