felixfbecker / php-language-server

PHP Implementation of the VS Code Language Server Protocol 🆚↔🖥
ISC License
1.15k stars 185 forks source link

Server is not parsing all php files with other extensions. #145

Open iddnet opened 7 years ago

iddnet commented 7 years ago

I think the server is not parsing all files which are set to be php language files. I am basing this overvation on the fact that I do not see any of these files in the language server output when it is parsing all of the files.

This would be helpful because some of us may have .inc files, and also .module files set to the php language. This is because Drupal and some of it's modules are using these extensions. Maybe we could query VS code for all files set to php language and include them as well.

Thanks!

felixfbecker commented 7 years ago

.inc and .module could be any language really though

kaloyan-raev commented 7 years ago

Perhaps, we could have a "valid PHP file extensions" (similar to CodeSniffer) configuration sent by the client.

sunverwerth commented 7 years ago

IMHO this is a real shortcoming in the protocol... the IDE should be the one to decide which files the language server needs to see. Not the other way around.

felixfbecker commented 7 years ago

the IDE should be the one to decide which files the language server needs to see

How can the IDE know what files the LS needs?

sunverwerth commented 7 years ago

How can the IDE know what files the LS needs?

Right now it can't. But this was more a thought about extending the LSP.

The LS could announce to the client the language(s) it supports and have the client send it a list of paths/file contents to parse. Most editors have a global map of suffix-->language after all.

felixfbecker commented 7 years ago

It's not as simple as that. LS don't only need files like *.php, they may also need files like composer.json, package.json, ... Requesting the files from the client is already being implemented in #136

corretge commented 7 years ago

With #136 excludes works?

I have this settings.json :

{
    "search.exclude": {
        "**/.git": true,
        "app/cache": true,
        "app/logs": true,
        "var": true,
        "vendor": true
    },
    "files.exclude": {
        "app/cache": true,
        "app/logs": true
    }
}

but app/cache folder is parsed. I'm executing version 3.0.1

            "name": "felixfbecker/language-server",
            "version": "v3.0.1",
            "source": {
                "type": "git",
                "url": "https://github.com/felixfbecker/php-language-server.git",
                "reference": "bec24383d4c0b896ff20bf94c7edc4714976c0e1"
felixfbecker commented 7 years ago

@corretge #136 has nothing to do with excludes, neither does this issue and neither do the settings search.exclude and files.exclude have anything to do with this server

phil-s commented 4 years ago

Is it still the case that we can't configure which file extensions are handled?