sublimelsp / LSP-intelephense

PHP support for Sublime's LSP plugin provided through intelephense.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not indexing .inc files

nkoporec opened this issue · comments

I'm using Drupal which has certain .inc files in core, I have set up sublime to always open .inc extensions as PHP files but the intelephense is returning functions defined in .inc files as undefined. If I open the .inc file manually then intelephense works as expected.

Is there any way of fixing this? The vscode intelephense extension works correctly, the only settings that I needed to add is the files.associations setting (which is the same as sublime open as setting).

Thanks the "associations" setting worked!

hi, how did you make it work?

I don't know if I am misunderstanding something, I am on ST3

// Settings in here override those in "LSP-intelephense/LSP-intelephense.sublime-settings"

{
	"settings": {
		"files": {
			"associations": [
				// default
				"*.php",
				"*.phtml",
				// my own
				"*.inc",
			],
		}
	}
}

found it, whit the help of #57 using LSP-json

// Settings in here override those in "LSP-intelephense/LSP-intelephense.sublime-settings"

{
	"settings": {
		"intelephense.files.associations": [
			// default
			"*.php",
			"*.phtml",
			// my own
			"*.inc",
			"*.service",
		],
	}
}

I can't figure this out. I am also using Drupal and recently trying LSP-intelephense, I added the settings properly:

// Settings in here override those in "LSP-json/LSP-json.sublime-settings"

{
  "settings": {
    "intelephense.format.braces": "k&r",
    "intelephense.files.associations": [
      "*.php",
      "*.phtml",
      // Extra
      "*.inc",
      "*.module",
      "*.install",
      "*.theme",
      "*.profile",
      "*.tpl.php",
      "*.test",
    ],
  },
}

But it's not working. It works if I open a .module file for instance, the symbols are there, but it doesn't find them globally. It does find symbols globally on php files

// Settings in here override those in "LSP-json/LSP-json.sublime-settings"

Are you using those settings for LSP-json? I had never thought that default line helps... but it does now.

@jfcherng I don't have LSP-json installed.

I enabled log_debug and log_server to panel and I see no lsp/intelephense output anywhere until I open a file

I enabled log_debug and log_server to panel and I see no lsp/intelephense output anywhere until I open a file

That's expected.

// Settings in here override those in "LSP-json/LSP-json.sublime-settings"
I don't have LSP-json installed.

Interesting...