Skip to content

Go to Symbol in File doesn't work. #1811

Closed

Description

Environment data

  • VS Code version: 1.23.1
  • Extension version (available under the Extensions sidebar): 2018.4.0
  • OS and version: Windows 7
  • Python version (& distribution if applicable, e.g. Anaconda): mingw-w64-i686-python3
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A

Actual behavior

Go to Symbol in File doesn't work.

I try trace something:

import jedi

print(jedi.api.names(source=None, path="e:/Downloads/1.py",all_scopes=True)[0].module_path)

python.org python3 output: e:\Downloads\1.py
mingw-w64-i686-python3 output: E:\Downloads\1.py

patch:

diff -urN a/extensions/ms-python.python-2018.4.0/out/client/providers/symbolProvider.js b/extensions/ms-python.python-2018.4.0/out/client/providers/symbolProvider.js
--- a/extensions/ms-python.python-2018.4.0/out/client/providers/symbolProvider.js	2018-05-22 10:28:17.916072100 +0800
+++ b/extensions/ms-python.python-2018.4.0/out/client/providers/symbolProvider.js	2018-05-28 13:05:10.873578100 +0800
@@ -10,13 +10,20 @@
 const telemetry_1 = require("../telemetry");
 const constants_1 = require("../telemetry/constants");
 const proxy = require("./jediProxy");
+const platform = require("os").platform();
 class PythonSymbolProvider {
     constructor(jediFactory) {
         this.jediFactory = jediFactory;
     }
     static parseData(document, data) {
         if (data) {
-            const symbols = data.definitions.filter(sym => sym.fileName === document.fileName);
+            const symbols = data.definitions.filter(sym => {
+                // msys2 fileName drive uppercase.
+                if(platform === "win32")
+                    return sym.fileName.toLowerCase() === document.fileName.toLowerCase()
+                return sym.fileName === document.fileName
+            });
+            
             return symbols.map(sym => {
                 const symbol = sym.kind;
                 const range = new vscode.Range(sym.range.startLine, sym.range.startColumn, sym.range.endLine, sym.range.endColumn);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    area-intellisenseLSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc.bugIssue identified by VS Code Team member as probable bug

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions