Skip to content

Commit 0d6490e

Browse files
committed
Show full python executable path in output for PyRight.
1 parent e7d99af commit 0d6490e

3 files changed

Lines changed: 36 additions & 9 deletions

File tree

plugins/com.python.pydev.analysis/src/com/python/pydev/analysis/pyright/PyrightAnalysis.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ public boolean equals(Object obj) {
9595
return false;
9696
}
9797
ModuleLineCol other = (ModuleLineCol) obj;
98-
return col == other.col && endCol == other.endCol && endLine == other.endLine && line == other.line && Objects.equals(moduleFile, other.moduleFile);
98+
return col == other.col && endCol == other.endCol && endLine == other.endLine && line == other.line
99+
&& Objects.equals(moduleFile, other.moduleFile);
99100
}
100101

101102
}
@@ -193,9 +194,9 @@ void createPyrightProcess(IExternalCodeAnalysisStream out)
193194
}
194195
cmdList.add(0, "pyright");
195196
String[] args = cmdList.toArray(new String[0]);
196-
WriteToStreamHelper.write("Pyright: Executing command line:", out, "python", "-m", args);
197197
SimplePythonRunner runner = new SimplePythonRunner();
198198
String[] parameters = SimplePythonRunner.preparePythonCallParameters(interpreter, "-m", args);
199+
WriteToStreamHelper.write("MyPy: Executing command line:", out, StringUtils.join(" ", parameters));
199200

200201
Tuple<Process, String> r = runner.run(parameters, workingDir, nature, monitor, null);
201202
return r.o1;
@@ -471,7 +472,8 @@ public void afterRunProcess(String output, String errors, IExternalCodeAnalysisS
471472
MessageInfo messageInfo = moduleLineColToMessage.get(moduleLineCol);
472473
if (messageInfo == null) {
473474
messageInfo = new MessageInfo(message, markerSeverity, messageId, line, column,
474-
endLine, endColumn, document.get(region.getOffset(), region.getLength()), moduleFile, document);
475+
endLine, endColumn, document.get(region.getOffset(), region.getLength()), moduleFile,
476+
document);
475477
moduleLineColToMessage.put(moduleLineCol, messageInfo);
476478
} else {
477479
messageInfo.addMessageLine(message);
@@ -491,7 +493,8 @@ public void afterRunProcess(String output, String errors, IExternalCodeAnalysisS
491493
}
492494
}
493495

494-
private void addToMarkers(String tok, int priority, String id, int line, int column, int endLine, int endColumn, String lineContents,
496+
private void addToMarkers(String tok, int priority, String id, int line, int column, int endLine, int endColumn,
497+
String lineContents,
495498
IFile moduleFile, IDocument document) {
496499
Map<String, Object> additionalInfo = new HashMap<>();
497500
additionalInfo.put(PyrightVisitor.PYRIGHT_MESSAGE_ID, id);

plugins/com.python.pydev.docs/release_email.txt

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
1-
PyDev 13.0.2 Released
1+
PyDev 13.1.0 Released
22

3-
PyDev 13.0.2 Release Highlights
3+
PyDev 13.1.0 Release Highlights
44
-------------------------------
55

6+
## Updates & Improvements
7+
8+
- It's now possible to use `pyright` analysis support
9+
- `pydevd` (debugger) updated to `3.4.1`
10+
- Preliminary support for debugging with `Python 3.14` (still not complete)
11+
- Consider `@abstractclassmethod` and `@abstractstaticmethod` decorators in code analysis.
12+
- Use plain `super()` in override completion.
13+
614
## Bug Fixes
715

8-
* Handle case where module.body could be null.
9-
* Improve type inference engine to deal with TypeAlias.
10-
* Fixes in code analysis to deal with TypeAlias.
16+
- If a default interpreter cannot be found, the latest Python 3 version is used to parse the code.
17+
- Type definition in non-global scope (inside a method) should not give an error if the token is just found in the TYPE_CHECKING namespace.
18+
- Fixed issues dealing with name store in match where spurious unused variable would be found. `#PyDev-1272`
1119

1220
About PyDev
1321
---------------------------

plugins/org.python.pydev.shared_core/src/org/python/pydev/shared_core/io/FileUtils.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,6 +1210,22 @@ private static char readChar(InputStream in) throws IOException {
12101210
return (char) i;
12111211
}
12121212

1213+
public static boolean isPrefixOf(File thisFile, File parentFile) {
1214+
File current = thisFile;
1215+
int parentLen = parentFile.getAbsolutePath().length();
1216+
1217+
while (current != null) {
1218+
if (current.equals(parentFile)) {
1219+
return true;
1220+
}
1221+
current = current.getParentFile();
1222+
if (current != null && current.getAbsolutePath().length() < parentLen) {
1223+
return false;
1224+
}
1225+
}
1226+
return false;
1227+
}
1228+
12131229
public static boolean isPrefixOf(IPath thisPath, IPath anotherPath) {
12141230
if (thisPath.getDevice() == null) {
12151231
if (anotherPath.getDevice() != null) {

0 commit comments

Comments
 (0)