sublimelsp / LSP

Client implementation of the Language Server Protocol for Sublime Text
https://lsp.sublimetext.io/
MIT License
1.65k stars 182 forks source link

Go to Definition by LSP seems not to utilize LSP properly for the new tab #845

Closed jfcherng closed 4 years ago

jfcherng commented 4 years ago

Env

LSP: 0.9.3 with LSP-intelephense LSP Server: intelephense Windows 7 x64

By the way, LSP 0.9.2 is fine.

Issue

New tabs opened by "LSP: Go to Definition" seem not to utilize LSP properly. After "lsp-intelephense initialized", there is no LSP functionality and no "lsp-intelephense" shown at the bottom-left corner. After closing the opened tab, the original tab has 2 lsp-intelephense at the bottom-left corner. If I do these steps again, there can be 3 lsp-intelephense and more.

Maybe related to Windows' path separator, idk.

LSP: path not in existing lsp-intelephense session: e:\WWW\nthu-ee-iframe\public\include\list_faculty_functions.php
LSP: path not in existing lsp-intelephense session: e:\WWW\nthu-ee-iframe\public\include\list_faculty_functions.php
LSP: window 2 requests lsp-intelephense for e:\WWW\nthu-ee-iframe\public\include\list_faculty_functions.php
LSP: starting ['node', 'C:\\Users\\Clover\\AppData\\Roaming\\Sublime Text 3\\Packages\\LSP-intelephense\\node_modules\\intelephense\\lib\\intelephense.js', '--stdio']
LSP: window 2 added session lsp-intelephense
LSP: multi folder session: [WorkspaceFolder('nthu-ee-iframe', 'E:\WWW\nthu-ee-iframe')]

Video Record

predragnikolic commented 4 years ago

I noticed this too.

It is not just LSP-intelephense :) good

This bug can be reproduced with all servers :)

The minimal steps to reporduce is for LSP-json (or any other language server). Open (or create) a .json file. Open command pallete. Type View Pack File Type .json and select a json file not from the currently open folder. This will print a message in the status line lsp-json initialized. But the server started in the wrong view. We now have two servers. in the first view. But none in the last selected view.

rwols commented 4 years ago

I can also reproduce this with python-language-server by doing "Go To Definition" on an imported module outside the project (for example import html in a py file and then goto def for that html token).

The fact that there is more than one status message in the status bar about what server is active is perhaps a different issue, but I'm not sure.

rwols commented 4 years ago

should be fixed by #850, please re-open if any issues arise.