pascal-language-server icon indicating copy to clipboard operation
pascal-language-server copied to clipboard

[Proposal] Broaden the config file search to include an `fpcupdeluxe` install.

Open gcarreno opened this issue 2 years ago • 15 comments

Hey Ryan(@genericptr),

When I finally came around to test this, since I'm now using Sublime-Text, I saw some issues. The double / and the read errors I've addressed in #82.

But there's another thing I've noticed: It expects some config files to be in places that only a system wide install will put them.

Since I've been a long term fpcupdeluxe user, those config files are not there. I, kinda, solved the issue with ln -s, soft links, but this is a bit annoying.

Could you consider broadening the config file search to include an fpcupdeluxe config folder? With an fpcupdeluxe install, both the files you're looking for are in InstallFolder/config_lazarus.

With an fpcupdeluxe install, these are the relevant paths:

  • Compiler: InstallFolder/fpc/bin/<CPU>-<OS>/ppc*
  • Compiler Source: InstallFolder/fpcsrc
  • Lazarus binary and source: InstallFolder/lazarus
  • Most *.xml configs: InstallFolder/config_lazarus

Thank you very much in advance!!

Cheers, Gus

gcarreno avatar Dec 30 '23 08:12 gcarreno

I'm not a Lazarus user so I don't have any useful feedback here. Searching more places seems smart to me but there may be unintended consequences I'm not aware of. What does @mvancanneyt think?

genericptr avatar Dec 30 '23 11:12 genericptr

Hey Ryan(@genericptr),

Those are indeed good and relevant points.

I think the only thing I can say is that, since fpcupdeluxe's thing is to have it all contained in a single folder, if we pass the "root" folder of said install, then the server should kinda be smart enough to get at it.

One thing would be to look for the very telling config_lazarus folder on the "root" folder. Then from there, assume an fpcupdeluxe install, opposite a system wide install.

So, Michaël(@mvancanneyt), what's your take on this?

Cheers, Gus

gcarreno avatar Dec 30 '23 12:12 gcarreno

There is no telling where fpcupdeluxe installs a lazarus. So you need to pass it on from the client.

And if we're going to have to pass folder locations anyway, then we better pass on the lazarus config folder directly. There is then no need to guess.

mvancanneyt avatar Dec 30 '23 16:12 mvancanneyt

Hey Michaël(@mvancanneyt),

And if we're going to have to pass folder locations anyway, then we better pass on the lazarus config folder directly.

Yes, absolutely, this makes tremendous sense.

My main gripe is that I'm completely unfamiliar with the current asked folders.

Could you please elaborate unto that? Many thanks !!

Cheers, Gus

gcarreno avatar Dec 30 '23 18:12 gcarreno

This article for Blaise Magazine hopefully will answer your question https://www.freepascal.org/~michael/articles/index.html#lazinvscode

If not, I'll try to elaborate....

mvancanneyt avatar Dec 30 '23 19:12 mvancanneyt

Hey Michaël(@mvancanneyt),

I'll read that article!! Thanks !!

I'm testing it under Sublime-Text, installed via snap. How far is the experience from VSCode?

Cheers, Gus

gcarreno avatar Dec 31 '23 00:12 gcarreno

Hey Michaël(@mvancanneyt),

I read the article. For one, it's quite VSCode centric, so I'm not sure what to think about Sublime-Text.

It doesn't mention the /etc/pasls.cfg file, neither it's structure, or if it overrides or is over-ridden by the values on Sublime's LSP plugin configuration. I actually added one to my system and deduced the INI values from code. But I'm not even sure it's making any difference...

Then there's this on the README.md for the sublime config:

"syntaxes": [
    "Packages/FPC/FPC.sublime-syntax"
]

which points to a file that is not explained where to get it.

I have many confusing questions about all of the above, and maybe some more will arise.

Cheers, Gus

gcarreno avatar Dec 31 '23 00:12 gcarreno

I don't use and don't know sublime text, so I cannot write about it. If you have questions about that part, Ryan will need to answer it, he is using Sublime Text.

VS Code is used most of all these days, but more importantly, it is the editor that introduced the language protocol. As such, it is to be expected that the article focuses on that.

mvancanneyt avatar Dec 31 '23 08:12 mvancanneyt

Then there's this on the README.md for the sublime config:

"syntaxes": [
    "Packages/FPC/FPC.sublime-syntax"
]

which points to a file that is not explained where to get it.

This seems like a mistake by me. Can you delete that line? That's my own syntax package which shouldn't be relevant. It may get sent the LSP package and used in some way though but I'm not sure.

genericptr avatar Dec 31 '23 12:12 genericptr

Hey Michaël(@mvancanneyt),

I understand the meaning of VSCode, and it's importance.

But you didn't answer my question about /etc/pasls.cfg importance in the hierarchy of acceptance of config.

Does it supersede the stuff on the LSP env section, of does that section take precedence?

Cheers, Gus

gcarreno avatar Dec 31 '23 13:12 gcarreno

Hey Ryan(@genericptr),

Okydokes, I'll delete that. Thanks!!

Can you also edit the README.md, please?

Many thanks!!

Cheers, Gus

gcarreno avatar Dec 31 '23 13:12 gcarreno

Hey Michaël(@mvancanneyt),

I understand the meaning of VSCode, and it's importance.

But you didn't answer my question about /etc/pasls.cfg importance in the hierarchy of acceptance of config.

Does it supersede the stuff on the LSP env section, of does that section take precedence?

Cheers, Gus

The ENV section takes precedence. The config file is in general only needed if you wish to use the proxy server, to specify the port. It is recommended to use the configuration possibilities of VSCode (or Sublime Text or whatever editor is used as client)

mvancanneyt avatar Dec 31 '23 14:12 mvancanneyt

Hey Michaël(@mvancanneyt),

Okidokes, gotcha!!

I'll delete my /etc/pasls.cfg then, since I'm not using the proxy.

I'll report more about the functionality on another issue, since I don't have hover working and the context menu, that in the zig LSP is filled, contains no items in the pasls.

But getting back to the original issue topic, is it hard to get the fpcupdeluxe install thing implemented?

Cheers, Gus

gcarreno avatar Dec 31 '23 21:12 gcarreno

if you mean add a 'lazarus config directory' config option: no, it should not be difficult.

mvancanneyt avatar Jan 01 '24 09:01 mvancanneyt

Hey Michaël(@mvancanneyt),

if you mean add a 'lazarus config directory' config option: no, it should not be difficult.

That's awesome to read !! Thanks!!

If I feel up to it, I'll probably dig into the code and offer a PR. :people_hugging:

Cheers, Gus

gcarreno avatar Jan 01 '24 23:01 gcarreno