Closed
Description
openedon May 31, 2018
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