Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

LSP not working when file opened by fuzzy finder #170

Open
extraymond opened this issue Jan 14, 2018 · 8 comments
Open

LSP not working when file opened by fuzzy finder #170

extraymond opened this issue Jan 14, 2018 · 8 comments

Comments

@extraymond
Copy link

Environment
Linux x64 ubuntu 16.04

Atom version
1.24.0.beta3, 1.23.1

Encountered situation

Greetings, I've encountered a weird behaviour.

If I open a file from the project file tree, python language server is working properly.
But if the file is opened by ctrl-p (opens fuzzy file finder), the linter and all the ide stuff is not working.

@rsese
Copy link

rsese commented Jan 17, 2018

Thanks for the report! I was unable to reproduce on Ubuntu 16.04 and Atom 1.24.0-beta3. I just used this file with a syntax error:

print("Hello Word!"

And when I open it with fuzzy finder, the error is reported in diagnostics. Can you reproduce with this simple example?

@rsese
Copy link

rsese commented Jan 17, 2018

Oh also, are you using https://github.com/lgeiger/ide-python? That's what I installed to test.

@extraymond
Copy link
Author

Yes! That's the one I'm using.
Here's the gif:

As you can see, if I open file with fuzzy select, the ide is idling.

atom

However, I've found that files opened with fuzzy selector will have the full path in the tab label.
In this case, since my project folder is inside another partition and linked to my home folder, I'm not sure if that's the symptom here.

2018-01-17 19-58-35

@rsese
Copy link

rsese commented Jan 17, 2018

However, I've found that files opened with fuzzy selector will have the full path in the tab label.
In this case, since my project folder is inside another partition and linked to my home folder, I'm not sure if that's the symptom here.

If you copy the project to your home folder, can you still reproduce?

Also, do you notice any errors in devtools console?

@damieng
Copy link
Contributor

damieng commented Jan 17, 2018

We only fire up the language server if the file you open is contained within the folder you have added to atom.

The nature of the LSP protocol requires that a language server is started in the folder above - if we allowed random files to be opened this way we'd have no direct way of knowing where the project folder is (we'd have to recurse up looking for clues) plus opening 5-6 random files could result in 5-6 language servers.

@extraymond
Copy link
Author

@rsese

Thx, If I add the project folder from the original directory, LSP works.

@damieng

Thx for clarifying! I agree that LSP should only be fired up in the given circumstances.

But since symlink is a very frequently used feature under UNIX workflow, if I add a project folder(in this case a symlink) to atom, I would expect atom to treat it like I'm adding the root to atom.

I've found settings related to symlink in atom settings, but no combination(Natimve/Emulation x Accept(symlink)) works.

Is LSP talks directly to file systems or via atom? If latter is the case I guess it's possible to fire-up LSP after atom confirms the location from symlink to root folder.

@damieng
Copy link
Contributor

damieng commented Jan 18, 2018

So you're adding a symlink then opening files from within it? If so, yes I agree that should work.

I suspect though the problem is how Atom is dealing internally with the file names given the tab also has absolute paths.

@damieng damieng changed the title LSP not working when file oppened by fuzzy finder LSP not working when file opened by fuzzy finder Feb 14, 2018
@UziTech
Copy link

UziTech commented Oct 19, 2020

Development of atom-languageclient has officially moved to https://github.com/atom-ide-community/atom-languageclient 🎉

If this is still an issue please consider opening an issue on that repo.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants