Skip to content

Defination and references not working #159

@serk1811

Description

@serk1811

Clean ubuntu 22.04, install sublime, install lsp, install LSP-intelephense
Try open project, and try to see definition/references for php function in my project, on 1 hover it's work, but on next got error and next log:

:: [17:23:05.193] --> LSP-intelephense initialize (1): {'processId': 67838, 'clientInfo': {'name': 'Sublime Text LSP', 'version': '2.8.2'}, 'rootUri': 'file:///var/www/project.com', 'rootPath': '/var/www/project.com', 'workspaceFolders': [{'name': 'project.com', 'uri': 'file:///var/www/project.com'}], 'capabilities': {'general': {'regularExpressions': {'engine': 'ECMAScript'}, 'markdown': {'parser': 'Python-Markdown', 'version': '3.2.2'}}, 'textDocument': {'synchronization': {'dynamicRegistration': True, 'didSave': True, 'willSave': True, 'willSaveWaitUntil': True}, 'hover': {'dynamicRegistration': True, 'contentFormat': ['markdown', 'plaintext']}, 'completion': {'dynamicRegistration': True, 'completionItem': {'snippetSupport': True, 'deprecatedSupport': True, 'documentationFormat': ['markdown', 'plaintext'], 'tagSupport': {'valueSet': [1]}, 'resolveSupport': {'properties': ['detail', 'documentation', 'additionalTextEdits']}, 'insertReplaceSupport': True, 'insertTextModeSupport': {'valueSet': [2]}, 'labelDetailsSupport': True}, 'completionItemKind': {'valueSet': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]}, 'insertTextMode': 2, 'completionList': {'itemDefaults': ['editRange', 'insertTextFormat', 'data']}}, 'signatureHelp': {'dynamicRegistration': True, 'contextSupport': True, 'signatureInformation': {'activeParameterSupport': True, 'documentationFormat': ['markdown', 'plaintext'], 'parameterInformation': {'labelOffsetSupport': True}}}, 'references': {'dynamicRegistration': True}, 'documentHighlight': {'dynamicRegistration': True}, 'documentSymbol': {'dynamicRegistration': True, 'hierarchicalDocumentSymbolSupport': True, 'symbolKind': {'valueSet': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]}, 'tagSupport': {'valueSet': [1]}}, 'documentLink': {'dynamicRegistration': True, 'tooltipSupport': True}, 'formatting': {'dynamicRegistration': True}, 'rangeFormatting': {'dynamicRegistration': True, 'rangesSupport': True}, 'declaration': {'dynamicRegistration': True, 'linkSupport': True}, 'definition': {'dynamicRegistration': True, 'linkSupport': True}, 'typeDefinition': {'dynamicRegistration': True, 'linkSupport': True}, 'implementation': {'dynamicRegistration': True, 'linkSupport': True}, 'codeAction': {'dynamicRegistration': True, 'codeActionLiteralSupport': {'codeActionKind': {'valueSet': ['quickfix', 'refactor', 'refactor.extract', 'refactor.inline', 'refactor.rewrite', 'source.fixAll', 'source.organizeImports']}}, 'dataSupport': True, 'isPreferredSupport': True, 'resolveSupport': {'properties': ['edit']}}, 'rename': {'dynamicRegistration': True, 'prepareSupport': True, 'prepareSupportDefaultBehavior': 1}, 'colorProvider': {'dynamicRegistration': True}, 'publishDiagnostics': {'relatedInformation': True, 'tagSupport': {'valueSet': [1, 2]}, 'versionSupport': True, 'codeDescriptionSupport': True, 'dataSupport': True}, 'diagnostic': {'dynamicRegistration': True, 'relatedDocumentSupport': True}, 'selectionRange': {'dynamicRegistration': True}, 'foldingRange': {'dynamicRegistration': True, 'foldingRangeKind': {'valueSet': ['comment', 'imports', 'region']}}, 'codeLens': {'dynamicRegistration': True}, 'inlayHint': {'dynamicRegistration': True, 'resolveSupport': {'properties': ['textEdits', 'label.command']}}, 'semanticTokens': {'dynamicRegistration': True, 'requests': {'range': True, 'full': {'delta': True}}, 'tokenTypes': ['namespace', 'type', 'class', 'enum', 'interface', 'struct', 'typeParameter', 'parameter', 'variable', 'property', 'enumMember', 'event', 'function', 'method', 'macro', 'keyword', 'modifier', 'comment', 'string', 'number', 'regexp', 'operator', 'decorator', 'label'], 'tokenModifiers': ['declaration', 'definition', 'readonly', 'static', 'deprecated', 'abstract', 'async', 'modification', 'documentation', 'defaultLibrary'], 'formats': ['relative'], 'overlappingTokenSupport': False, 'multilineTokenSupport': True, 'augmentsSyntaxTokens': True}, 'callHierarchy': {'dynamicRegistration': True}, 'typeHierarchy': {'dynamicRegistration': True}}, 'workspace': {'applyEdit': True, 'didChangeConfiguration': {'dynamicRegistration': True}, 'executeCommand': {}, 'workspaceEdit': {'documentChanges': True, 'failureHandling': 'abort', 'changeAnnotationSupport': {'groupsOnLabel': False}}, 'workspaceFolders': True, 'symbol': {'dynamicRegistration': True, 'resolveSupport': {'properties': ['location.range']}, 'symbolKind': {'valueSet': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]}, 'tagSupport': {'valueSet': [1]}}, 'configuration': True, 'codeLens': {'refreshSupport': True}, 'fileOperations': {'dynamicRegistration': True, 'willRename': True, 'didRename': True}, 'inlayHint': {'refreshSupport': True}, 'semanticTokens': {'refreshSupport': True}, 'diagnostics': {'refreshSupport': True}}, 'window': {'showDocument': {'support': True}, 'showMessage': {'messageActionItem': {'additionalPropertiesSupport': True}}, 'workDoneProgress': True}}, 'initializationOptions': {'clearCache': False}}
:: [17:23:05.525] <-  LSP-intelephense window/logMessage: {'type': 3, 'message': 'Initialising intelephense 1.16.5'}
:: [17:23:05.527] <-  LSP-intelephense window/logMessage: {'type': 3, 'message': 'Reading state from /tmp/intelephense/14b62a52.'}
:: [17:23:05.594] <-  LSP-intelephense window/logMessage: {'type': 3, 'message': 'Initialised in 66 ms'}
:: [17:23:05.594] <<< LSP-intelephense (1) (duration: 400ms): {'capabilities': {'documentSymbolProvider': True, 'workspaceSymbolProvider': True, 'completionProvider': {'triggerCharacters': ['$', '>', ':', '\\', '/', "'", '"', '*', '.', '<'], 'resolveProvider': True}, 'signatureHelpProvider': {'triggerCharacters': ['(', ',', ':']}, 'definitionProvider': True, 'documentFormattingProvider': False, 'documentRangeFormattingProvider': False, 'referencesProvider': True, 'hoverProvider': True, 'documentHighlightProvider': True, 'foldingRangeProvider': False, 'implementationProvider': False, 'declarationProvider': False, 'workspace': {'workspaceFolders': {'supported': True, 'changeNotifications': True}}, 'renameProvider': False, 'typeDefinitionProvider': False, 'selectionRangeProvider': False, 'codeActionProvider': False, 'typeHierarchyProvider': False, 'textDocumentSync': {'didOpen': {}, 'save': {}, 'didClose': {}, 'change': {'syncKind': 2}}}}
:: [17:23:05.595]  -> LSP-intelephense initialized: {}
:: [17:23:05.597]  -> LSP-intelephense workspace/didChangeConfiguration: {'settings': {'statusText': '{% if server_version %}v{{ server_version }}{% endif %}'}}
:: [17:23:05.603]  -> LSP-intelephense textDocument/didOpen: {'textDocument': {'uri': 'file:///var/www/project.com/footer.php', 'languageId': 'php', 'version': 0, 'text': "<?php\n/*\n* 2007-2011 PrestaShop \n*\n* NOTICE OF LICENSE\n*\n* This source file is subject to the Open Software License (OSL 3.0)\n* that is bundled with this package in the file LICENSE.txt.\n* It is also available through the world-wide-web at this URL:\n* http://opensource.org/licenses/osl-3.0.php\n* If you did not receive a copy of the license and are unable to\n* obtain it through the world-wide-web, please send an email\n* to license@prestashop.com so we can send you a copy immediately.\n*\n* DISCLAIMER\n*\n* Do not edit or add to this file if you wish to upgrade PrestaShop to newer\n* versions in the future. If you wish to customize PrestaShop for your\n* needs please refer to http://www.prestashop.com for more information.\n*\n*  @author PrestaShop SA <contact@prestashop.com>\n*  @copyright  2007-2011 PrestaShop SA\n*  @version  Release: $Revision: 6594 $\n*  @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)\n*  International Registered Trademark & Property of PrestaShop SA\n*/\n\nif (class_exists('FrontController')){\n\t$controller = new FrontController();\n\t$controller->displayFooter();\n}\nelse {\n\tinclude_once (dirname(__FILE__).'/config/config.inc.php');\n\tTools::display404Error();\n}\n"}}
:: [17:23:05.606] <-- LSP-intelephense workspace/configuration (0): {'items': [{'section': 'intelephense'}, {'section': 'intelephense', 'scopeUri': 'file:///var/www/project.com'}]}
:: [17:23:05.606] >>> LSP-intelephense (0) (duration: 0ms): [None, None]
:: [17:23:05.641] <-  LSP-intelephense window/logMessage: {'type': 1, 'message': 'TypeError: e.children.at is not a function\n    at Ee (/home/sergei/.cache/sublime-text/Package Storage/LSP-intelephense/language-server/node_modules/intelephense/lib/intelephense.js:2:3088640)\n    at /home/sergei/.cache/sublime-text/Package Storage/LSP-intelephense/language-server/node_modules/intelephense/lib/intelephense.js:2:3071210\n    at de (/home/sergei/.cache/sublime-text/Package Storage/LSP-intelephense/language-server/node_modules/intelephense/lib/intelephense.js:2:3071271)\n    at Rt (/home/sergei/.cache/sublime-text/Package Storage/LSP-intelephense/language-server/node_modules/intelephense/lib/intelephense.js:2:3124155)\n    at de (/home/sergei/.cache/sublime-text/Package Storage/LSP-intelephense/language-server/node_modules/intelephense/lib/intelephense.js:2:3087130)\n    at Rt (/home/sergei/.cache/sublime-text/Package Storage/LSP-intelephense/language-server/node_modules/intelephense/lib/intelephense.js:2:3124155)\n    at /home/sergei/.cache/sublime-text/Package Storage/LSP-intelephense/language-server/node_modules/intelephense/lib/intelephense.js:2:3131582\n    at Object.e.traverse (/home/sergei/.cache/sublime-text/Package Storage/LSP-intelephense/language-server/node_modules/intelephense/lib/intelephense.js:2:3131609)\n    at b.compileDocument (/home/sergei/.cache/sublime-text/Package Storage/LSP-intelephense/language-server/node_modules/intelephense/lib/intelephense.js:2:74668)\n    at b.open (/home/sergei/.cache/sublime-text/Package Storage/LSP-intelephense/language-server/node_modules/intelephense/lib/intelephense.js:2:68532)'}
:: [17:23:05.642] <-- LSP-intelephense client/registerCapability (1): {'registrations': [{'id': '4eb13062-da5a-4756-a578-366e9006f782', 'method': 'textDocument/formatting', 'registerOptions': {'documentSelector': [{'language': 'php', 'scheme': 'file'}, {'language': 'php', 'scheme': 'untitled'}]}}, {'id': '5d9bb438-fbc8-4115-a06a-c9dbf98b6d60', 'method': 'textDocument/rangeFormatting', 'registerOptions': {'documentSelector': [{'language': 'php', 'scheme': 'file'}, {'language': 'php', 'scheme': 'untitled'}]}}]}
:: [17:23:05.643] >>> LSP-intelephense (1) (duration: 0ms): None
:: [17:23:05.643] <-- LSP-intelephense client/registerCapability (2): {'registrations': [{'id': '68afd28d-722d-4b42-891c-f19890b0e0b8', 'method': 'workspace/didChangeConfiguration', 'registerOptions': {'section': 'intelephense'}}]}
:: [17:23:05.643] >>> LSP-intelephense (2) (duration: 0ms): None
:: [17:23:05.656] <-  LSP-intelephense window/logMessage: {'type': 3, 'message': 'Searching file:///home/sergei/.cache/sublime-text/Package%20Storage/LSP-intelephense/language-server/node_modules/intelephense/lib/stub for files to index.'}
:: [17:23:05.665] <-  LSP-intelephense window/logMessage: {'type': 3, 'message': 'Searching file:///var/www/project.com for files to index.'}
:: [17:23:09.754]  -> LSP-intelephense textDocument/didOpen: <params with 83069 characters>
:: [17:23:09.795] <-  LSP-intelephense window/logMessage: {'type': 1, 'message': 'TypeError: e.children.at is not a function\n    at /home/sergei/.cache/sublime-text/Package Storage/LSP-intelephense/language-server/node_modules/intelephense/lib/intelephense.js:2:3075859\n    at de (/home/sergei/.cache/sublime-text/Package Storage/LSP-intelephense/language-server/node_modules/intelephense/lib/intelephense.js:2:3077025)\n    at Rt (/home/sergei/.cache/sublime-text/Package Storage/LSP-intelephense/language-server/node_modules/intelephense/lib/intelephense.js:2:3124155)\n    at de (/home/sergei/.cache/sublime-text/Package Storage/LSP-intelephense/language-server/node_modules/intelephense/lib/intelephense.js:2:3087130)\n    at Rt (/home/sergei/.cache/sublime-text/Package Storage/LSP-intelephense/language-server/node_modules/intelephense/lib/intelephense.js:2:3124155)\n    at /home/sergei/.cache/sublime-text/Package Storage/LSP-intelephense/language-server/node_modules/intelephense/lib/intelephense.js:2:3131582\n    at Object.e.traverse (/home/sergei/.cache/sublime-text/Package Storage/LSP-intelephense/language-server/node_modules/intelephense/lib/intelephense.js:2:3131609)\n    at b.compileDocument (/home/sergei/.cache/sublime-text/Package Storage/LSP-intelephense/language-server/node_modules/intelephense/lib/intelephense.js:2:74668)\n    at b.open (/home/sergei/.cache/sublime-text/Package Storage/LSP-intelephense/language-server/node_modules/intelephense/lib/intelephense.js:2:68532)\n    at t.Intelephense.openDocument (/home/sergei/.cache/sublime-text/Package Storage/LSP-intelephense/language-server/node_modules/intelephense/lib/intelephense.js:2:3578377)'}
:: [17:23:10.056] --> LSP-intelephense textDocument/documentHighlight (2): {'textDocument': {'uri': 'file:///var/www/project.com/classes/Tools.php'}, 'position': {'line': 2203, 'character': 24}}
:: [17:23:10.059] <<< LSP-intelephense (2) (duration: 2ms): None
:: [17:23:11.084] --> LSP-intelephense textDocument/hover (3): {'textDocument': {'uri': 'file:///var/www/project.com/classes/Tools.php'}, 'position': {'line': 2203, 'character': 33}}
:: [17:23:11.087] <<< LSP-intelephense (3) (duration: 2ms): None
:: [17:23:15.774] --> LSP-intelephense textDocument/hover (4): {'textDocument': {'uri': 'file:///var/www/project.com/footer.php'}, 'position': {'line': 33, 'character': 18}}
:: [17:23:15.776] <<< LSP-intelephense (4) (duration: 2ms): None
:: [17:24:52.999] --> LSP-intelephense textDocument/documentHighlight (5): {'textDocument': {'uri': 'file:///var/www/project.com/footer.php'}, 'position': {'line': 16, 'character': 76}}
:: [17:24:53.002] <<< LSP-intelephense (5) (duration: 2ms): None
:: [17:24:54.073] --> LSP-intelephense textDocument/hover (6): {'textDocument': {'uri': 'file:///var/www/project.com/footer.php'}, 'position': {'line': 11, 'character': 57}}
:: [17:24:54.075] <<< LSP-intelephense (6) (duration: 2ms): None
:: [17:25:20.011] --> LSP-intelephense textDocument/hover (7): {'textDocument': {'uri': 'file:///var/www/project.com/footer.php'}, 'position': {'line': 33, 'character': 14}}
:: [17:25:20.013] <<< LSP-intelephense (7) (duration: 1ms): None
:: [17:25:20.690] --> LSP-intelephense textDocument/hover (8): {'textDocument': {'uri': 'file:///var/www/project.com/footer.php'}, 'position': {'line': 33, 'character': 14}}
:: [17:25:20.692] <<< LSP-intelephense (8) (duration: 2ms): None
:: [17:25:21.418] --> LSP-intelephense textDocument/hover (9): {'textDocument': {'uri': 'file:///var/www/project.com/footer.php'}, 'position': {'line': 33, 'character': 14}}
:: [17:25:21.421] <<< LSP-intelephense (9) (duration: 2ms): None
:: [17:25:22.398] --> LSP-intelephense textDocument/hover (10): {'textDocument': {'uri': 'file:///var/www/project.com/footer.php'}, 'position': {'line': 33, 'character': 14}}
:: [17:25:22.401] <<< LSP-intelephense (10) (duration: 2ms): None

Interested part
:: [17:23:05.641] <- LSP-intelephense window/logMessage: {'type': 1, 'message': 'TypeError: e.children.at is not a function\n at Ee (/home/sergei/.cache/sublime-text/Package Storage/LSP-intelephense/language-server/node_modules/intelephense/lib/intelephense.js:2:3088640)\n at /home/sergei/.cache/sublime-text/Package Storage/LSP-intelephense/language-server/node_modules/intelephense/lib/intelephense.js:2:3071210\n at de (/home/sergei/.cache/sublime-text/Package Storage/LSP-intelephense/language-server/node_modules/intelephense/lib/intelephense.js:2:3071271)\n at Rt (/home/sergei/.cache/sublime-text/Package Storage/LSP-intelephense/language-server/node_modules/intelephense/lib/intelephense.js:2:3124155)\n at de (/home/sergei/.cache/sublime-text/Package Storage/LSP-intelephense/language-server/node_modules/intelephense/lib/intelephense.js:2:3087130)\n at Rt (/home/sergei/.cache/sublime-text/Package Storage/LSP-intelephense/language-server/node_modules/intelephense/lib/intelephense.js:2:3124155)\n at /home/sergei/.cache/sublime-text/Package Storage/LSP-intelephense/language-server/node_modules/intelephense/lib/intelephense.js:2:3131582\n at Object.e.traverse (/home/sergei/.cache/sublime-text/Package Storage/LSP-intelephense/language-server/node_modules/intelephense/lib/intelephense.js:2:3131609)\n at b.compileDocument (/home/sergei/.cache/sublime-text/Package Storage/LSP-intelephense/language-server/node_modules/intelephense/lib/intelephense.js:2:74668)\n at b.open (/home/sergei/.cache/sublime-text/Package Storage/LSP-intelephense/language-server/node_modules/intelephense/lib/intelephense.js:2:68532)'}
My config for lsp

{
  "clients": {
    "intelephense": {
      "command": [
        "/home/sergei/.nvm/versions/node/v16.20.2/bin/node",
        "/home/sergei/.cache/sublime-text/Package Storage/LSP-intelephense/language-server/node_modules/intelephense/lib/intelephense.js",
        "--stdio"
      ],
      "settings": {
        "intelephense": {
          "clearCache": true,
          "files": {
            "maxSize": 10000000,
            "exclude": [
              "**/vendor/**",
              "**/cache/**",
              "**/node_modules/**"
            ]
          },
          "environment": {
            "phpVersion": "7.4"   // Соответствует версии PrestaShop
          },
          "hover": {
            "enabled": true
          },
          "completion": {
            "fullyQualifyGlobalConstantsAndFunctions": true
          }
        }
      }
    }
  }
}

Sorry if my issue/question stupid, but i try it fix all my day, install diff node/ reinstall by 100 times, nothing got worked

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions