profile
viewpoint
Fabio Zadrozny fabioz Python enthusiast. Maintainer of PyDev, PyDev.Debugger, LiClipse, LiClipseText, PyVmMonitor and mu-repo

ESSS/conda-devenv 71

A conda tool to work with multiple projects in development mode.

ESSS/py4eng-course 32

A crash course of Python taught by ESSS software devs

ESSS/qmxgraph 22

A Qt graph drawing widget using JavaScript's mxGraph library.

ESSS/esss_fix_format 19

Simple code formatter and pre-commit checker used internally by ESSS

ESSS/notebooks 19

This repo contains notebooks that explaining some cool stuff we learn every now and then...

ESSS/err-jenkins 18

errbot plugin for Jenkins

ESSS/jobs_done10 18

Travis like .yaml file for generating Jenkins jobs

ESSS/deps 17

A tool to manipulate running commands in a project and its dependencies

ESSS/bung 13

Python package for interface implementation with decorators

ESSS/cookiecutter-esss-pypackage 13

A minimal template to publish open source python packages

created tagrobocorp/robotframework-lsp

tagrobotframework-lsp-0.4.2

Language Server Protocol implementation for Robot Framework

created time in 5 hours

push eventrobocorp/robotframework-lsp

Fabio Zadrozny

commit sha 834ebf6329d7c9a6edda7615d0fc38078818760e

RobotFramework Language Server Release 0.4.2

view details

push time in 5 hours

push eventrobocorp/robotframework-lsp

Fabio Zadrozny

commit sha ad8fca89a6503ba0282365dd4ad7fc0948d06c74

Release Robocorp Code 0.1.0.

view details

Fabio Zadrozny

commit sha 1957f5d9d0ac841df0ee235e701234e1a0088141

Use rcc env variables to get the needed environment variables from robot.yaml. Fixes #159 Also uses devdata/env.json if available.

view details

Fabio Zadrozny

commit sha fce4727ee6dddd29637afa5900734f63dcdb2469

Make sure that we use rcc env variables from robot.yaml in the launch too. Fixes #159

view details

Fabio Zadrozny

commit sha d9199729cf8d6ddda93a334dbdc4902f613d66ca

insertText attribute value assigned for CompletionItem. Fixes #158

view details

Fabio Zadrozny

commit sha 42d5ae4664d36687e757e651630b165c2c8a9957

Release Robocorp Code 0.1.1.

view details

Fabio Zadrozny

commit sha 834ebf6329d7c9a6edda7615d0fc38078818760e

RobotFramework Language Server Release 0.4.2

view details

push time in 5 hours

created tagrobocorp/robotframework-lsp

tagrobocorp-code-0.1.1

Language Server Protocol implementation for Robot Framework

created time in 5 hours

push eventrobocorp/robotframework-lsp

Fabio Zadrozny

commit sha 42d5ae4664d36687e757e651630b165c2c8a9957

Release Robocorp Code 0.1.1.

view details

push time in 5 hours

PR closed robocorp/robotframework-lsp

insertText attribute value assigned for CompletionItem

Pull request suggestion for issue #158

+6 -1

3 comments

6 changed files

avaissi

pr closed time in 5 hours

pull request commentrobocorp/robotframework-lsp

insertText attribute value assigned for CompletionItem

As I had to make changes for the tests, I ended up creating a new commit for the merge (so, was added in: https://github.com/robocorp/robotframework-lsp/commit/d9199729cf8d6ddda93a334dbdc4902f613d66ca).

avaissi

comment created time in 5 hours

push eventrobocorp/robotframework-lsp

Fabio Zadrozny

commit sha d9199729cf8d6ddda93a334dbdc4902f613d66ca

insertText attribute value assigned for CompletionItem. Fixes #158

view details

push time in 5 hours

issue closedrobocorp/robotframework-lsp

Add insertText to CompletionItem

jupyterlab-lsp extension is using insertText attribute of the returned CompletionItem and ignoring the text_edit attribute. This is causing the extension to behave unexpectedly with RobotFramework LS

Needed:

Single field addition to returned CompletionItem.

For example: robotframework-ls/src/robotframework_ls/impl/keyword_completions.py

insertText=text_edit.newText

return CompletionItem(
            keyword_found.keyword_name,
            kind=keyword_found.completion_item_kind,
            text_edit=text_edit,
            insertText=text_edit.newText,
            documentation=keyword_found.docs,
            insertTextFormat=InsertTextFormat.Snippet,
            documentationFormat=(
                MarkupKind.Markdown
                if keyword_found.docs_format == "markdown"
                else MarkupKind.PlainText
            ),
        ).to_dict()

closed time in 5 hours

avaissi

push eventrobocorp/robotframework-lsp

Fabio Zadrozny

commit sha d9199729cf8d6ddda93a334dbdc4902f613d66ca

insertText attribute value assigned for CompletionItem. Fixes #158

view details

push time in 5 hours

create barnchrobocorp/robotframework-lsp

branch : avaissi-master

created branch time in 5 hours

push eventrobocorp/robotframework-lsp

Fabio Zadrozny

commit sha fce4727ee6dddd29637afa5900734f63dcdb2469

Make sure that we use rcc env variables from robot.yaml in the launch too. Fixes #159

view details

push time in 7 hours

push eventrobocorp/robotframework-lsp

Fabio Zadrozny

commit sha 1957f5d9d0ac841df0ee235e701234e1a0088141

Use rcc env variables to get the needed environment variables from robot.yaml. Fixes #159 Also uses devdata/env.json if available.

view details

Fabio Zadrozny

commit sha 702dae6f91d8be64180ca39ce4f345cd59f2fd93

Release Robocorp Code 0.1.1.

view details

push time in 9 hours

push eventrobocorp/robotframework-lsp

Fabio Zadrozny

commit sha 1957f5d9d0ac841df0ee235e701234e1a0088141

Use rcc env variables to get the needed environment variables from robot.yaml. Fixes #159 Also uses devdata/env.json if available.

view details

push time in 9 hours

issue closedrobocorp/robotframework-lsp

Use rcc env variables to get the needed environment variables from robot.yaml

i.e.: Something as:

rcc env variables -r robot.yaml -e devdata/env.json

closed time in 9 hours

fabioz

create barnchrobocorp/robotframework-lsp

branch : env_159

created branch time in 9 hours

issue commentrobocorp/robotframework-lsp

Add insertText to CompletionItem

Yes, it should be ok to add. It doesn't break other places as it should actually be ignored -- at least that's what the spec says ;)

Only the tests need to be updated (if it's hard for you to get the env up to date to regenerate the expected files I can update it here).

avaissi

comment created time in 10 hours

pull request commentrobocorp/robotframework-lsp

insertText attribute value assigned for CompletionItem

Tests are failing because the expected data changed.

Most should be related to https://github.com/ESSS/pytest-regressions.

To force the update of the expected files it should be possible to call something as: pytest -n auto --force-regen (it should fail the time it regenerates the expected files and should pass on subsequent runs).

If you want I can update it here...

avaissi

comment created time in 10 hours

issue openedrobocorp/robotframework-lsp

Use rcc env variables to get the needed environment variables from robot.yaml

i.e.: Something as:

rcc env variables -r robot.yaml -e devdata/env.json

created time in 10 hours

issue commentrobocorp/robotframework-lsp

Add insertText to CompletionItem

Ok, it should be straightforward to add that, still, note that the insertText leaves too much up to interpretation from the client (which may end up not doing what is actually expected on some cases), so, ideally the jupyterlab-lsp extension would be fixed to do the right thing here...

i.e.: Spec (https://microsoft.github.io/language-server-protocol/specification) details on the related fields for CompletionItem

/**
 * A string that should be inserted into a document when selecting
 * this completion. When `falsy` the label is used.
 *
 * The `insertText` is subject to interpretation by the client side.
 * Some tools might not take the string literally. For example
 * VS Code when code complete is requested in this example `con<cursor position>`
 * and a completion item with an `insertText` of `console` is provided it
 * will only insert `sole`. Therefore it is recommended to use `textEdit` instead
 * since it avoids additional client side interpretation.
 */
insertText?: string;

/**
 * An edit which is applied to a document when selecting this completion. When an edit is provided the value of
 * `insertText` is ignored.
 *
 * *Note:* The range of the edit must be a single line range and it must contain the position at which completion
 * has been requested.
 */
textEdit?: TextEdit;
avaissi

comment created time in 12 hours

created tagrobocorp/robotframework-lsp

tagrobocorp-code-0.1.0

Language Server Protocol implementation for Robot Framework

created time in a day

push eventrobocorp/robotframework-lsp

Fabio Zadrozny

commit sha ad8fca89a6503ba0282365dd4ad7fc0948d06c74

Release Robocorp Code 0.1.0.

view details

push time in a day

push eventrobocorp/robotframework-lsp

Fabio Zadrozny

commit sha ad8fca89a6503ba0282365dd4ad7fc0948d06c74

Release Robocorp Code 0.1.0.

view details

push time in a day

push eventrobocorp/robotframework-lsp

Fabio Zadrozny

commit sha 5e79150767716ca0d9d8cfdc1a1be413b8564f11

Release Robocorp Code 0.1.0.

view details

push time in a day

push eventrobocorp/robotframework-lsp

Fabio Zadrozny

commit sha 208905ef2d9a1c3571014201d926456a3a9f2ef6

Plugin directories are now loaded during initalization and not after initialization. Fixes #155

view details

Fabio Zadrozny

commit sha 616cab3dfef8570ced57186d4fdeb6b0b6408b66

Update Robocorp Code logo. Fixes #154

view details

Fabio Zadrozny

commit sha a6bfb309e49314664d0ddfbcddf70f199dadb36e

RobotFramework Language Server Release 0.4.1

view details

Fabio Zadrozny

commit sha 7bd332b6d3cdc576f2b9c1ca1008d41c4bd19d35

Release Robocorp Code 0.1.0.

view details

push time in a day

created tagrobocorp/robotframework-lsp

tagrobotframework-lsp-0.4.1

Language Server Protocol implementation for Robot Framework

created time in a day

push eventrobocorp/robotframework-lsp

Fabio Zadrozny

commit sha a6bfb309e49314664d0ddfbcddf70f199dadb36e

RobotFramework Language Server Release 0.4.1

view details

push time in a day

push eventrobocorp/robotframework-lsp

Fabio Zadrozny

commit sha 756c6df8ee27f58c7b5976406ff8b0bbdd185ed1

RobotFramework Language Server Release 0.4.0

view details

Fabio Zadrozny

commit sha 8380fe16ba613849ae250dc1d8561a4a27c84b50

Renamed activity->robot, working with RCC 2, new action to log in to cloud. Fixes #151

view details

Fabio Zadrozny

commit sha 1ca3d10e083d67b20f122655de1adbc5f0b9b716

Filter by workspace on upload to cloud. Fixes #136

view details

Fabio Zadrozny

commit sha ed8080a62b4d5933423327e83d08fddf6cdb2092

Mark Robocorp Code as requiring robotframework-lsp in the VSCode marketplace. Fixes #147

view details

Fabio Zadrozny

commit sha 35dc526b136d0fc46194f6beb85eb169c13e5dc1

Remove extension dependency because VSCode becomes confused with the activation order.

view details

Fabio Zadrozny

commit sha efd68c2105fefa08b80fcbbf4eda5355e83cca4a

Improve upload to cloud (always show workspace/show as first if name matches).

view details

Fabio Zadrozny

commit sha 1fac667b8d082b73e43759b2a285c4ab243d23c9

Release Robocorp Code 0.0.5.

view details

Fabio Zadrozny

commit sha 208905ef2d9a1c3571014201d926456a3a9f2ef6

Plugin directories are now loaded during initalization and not after initialization. Fixes #155

view details

Fabio Zadrozny

commit sha 616cab3dfef8570ced57186d4fdeb6b0b6408b66

Update Robocorp Code logo. Fixes #154

view details

Fabio Zadrozny

commit sha a6bfb309e49314664d0ddfbcddf70f199dadb36e

RobotFramework Language Server Release 0.4.1

view details

push time in a day

issue closedrobocorp/robotframework-lsp

Create actions to turn logging on/off

Is your feature request related to a problem? Please describe. Users should not have to restart the language server to turn the logging on/off.

Describe the solution you'd like Create an action to turn the logging on or off just temporarily without having to restart the language server (potentially this would just change a related setting and the language server would start/stop logging instead of having to pass it in the arguments as it is right now).

closed time in a day

fabioz

issue commentrobocorp/robotframework-lsp

Create actions to turn logging on/off

Moving to maybe later.

fabioz

comment created time in a day

push eventrobocorp/robotframework-lsp

Fabio Zadrozny

commit sha 616cab3dfef8570ced57186d4fdeb6b0b6408b66

Update Robocorp Code logo. Fixes #154

view details

push time in a day

issue commentrobocorp/robotframework-lsp

Code analysis for variables

Moving to maybe later.

fabioz

comment created time in a day

issue commentrobocorp/robotframework-lsp

Code analysis: validate keyword arguments

Moving to backlog.

fabioz

comment created time in a day

issue closedrobocorp/robotframework-lsp

Configuring and running linter tool together with LSP

Visual Studio Code and some other IDEs have built in support for linter tools like pylint, pep8 etc that can be configured and run on file save.

It would be awesome to have this with Robot Framework plugin. I'm coauthor of Robocop which can be used to scan robot files. I have general idea where we could put this. According to documentation from Microsoft for LSP server we can use Diagnostic. RF LSP have basic implemention of it under Url but it does only cover missing keywords.

What we need in short? To be able to configure and start our application in LSP startup and then call it with something like scan_file(path) everytime we need analysis. Of course I need to update Robocop to be able to run it continously like that and to return analysis results in format suitable for LSP.

I could also try to raise PR here but it would be good to discuss proposed architecture first.

closed time in a day

bhirsz

issue commentrobocorp/robotframework-lsp

Configuring and running linter tool together with LSP

I'm closing and marking this as maybe later as I won't be getting this myself in the mid-short term (still, feel free to create a pull request and I'll review it or comment more on the issue itself... i.e.: only the issues that I have a plan to tackle in the mid-short term with a higher priority are kept in the open state).

bhirsz

comment created time in a day

push eventrobocorp/robotframework-lsp

Fabio Zadrozny

commit sha 208905ef2d9a1c3571014201d926456a3a9f2ef6

Plugin directories are now loaded during initalization and not after initialization. Fixes #155

view details

push time in a day

issue closedrobocorp/robotframework-lsp

Concurrency issue on startup when doing file analysis.

Upon opening the tasks.robot (the first time that the extension is activated) in the .zip file attached the language server initially does an analysis with the wrong python interpreter (instead of already using one based on robot.yaml).

test-robot.zip

closed time in a day

fabioz

issue openedrobocorp/robotframework-lsp

Provide launching directly through RCC.

This would allow users to launch non-robotframework files with the expected env.

created time in a day

create barnchrobocorp/robotframework-lsp

branch : concurrency_155

created branch time in a day

issue commentrobocorp/robotframework-lsp

Concurrency issue on startup when doing file analysis.

More specifically, what happens is:

...

lsp: 2020-09-28 08:45:58 UTC pid: 10152 - MainThread - DEBUG - robocorp_ls_core.jsonrpc.streams
Writing: {'jsonrpc': '2.0', 'id': 2, 'method': 'textDocument/didOpen', 'params': {'textDocument': {'uri': 'file:///c%3A/temp/test-robot/tasks.robot', 'version': 1, 'text': '*** Settings ***\nDocumentation     An example robot.\nLibrary           RPA.Browser\n\n*** Tasks ***\nMinimal task\n    Open Available Browser    https://greenstep.fi/\n    Click Element When Visible    css:a.cc-allow\n'}}}

... Code analysis started here

lsp: 2020-09-28 08:45:58 UTC pid: 10152 - MainThread - DEBUG - robocorp_ls_core.jsonrpc.streams
Read: {"jsonrpc":"2.0","id":1,"method":"workspace/executeCommand","params":{"command":"robot.addPluginsDir","arguments":["c:\\Users\\fabio\\.vscode\\extensions\\robocorp.robocorp-code-0.0.5\\src\\robocorp_code\\plugins"]}}

... Extension to handle robot.yaml files only added afterwards
fabioz

comment created time in a day

issue openedrobocorp/robotframework-lsp

Concurrency issue on startup when doing file analysis.

Upon opening the tasks.robot (the first time that the extension is activated) in the .zip file attached the language server initially does an analysis with the wrong python interpreter (instead of already using one based on robot.yaml).

test-robot.zip

created time in a day

push eventfabioz/Pydev

Luis Cabral

commit sha 69df9841ae0783334e95c56d96d870ef0c73dfb6

Code-completion now recognizes walrus operator. Fixes #PyDev-1102

view details

push time in a day

Pull request review commentfabioz/Pydev

Fix for #Pydev 1102: Code-completion does not work with walrus operator properly.

 public void testCodeCompletionPep484Return2() throws Exception {         requestCompl(s, s.length(), -1, new String[] { "bar()" });     } +    public void testCompletionWithWalrus() throws Exception {+        String s;+        String original = "" ++                "def test_anything():\n" ++                "    while a := 10:\n" ++                "        a.";+        s = StringUtils.format(original, "");+        ICompletionProposalHandle[] proposals = requestCompl(s, s.length(), -1,+                new String[] { "as_integer_ratio()", "bit_length()", "conjugate()", "denominator" });+        assertEquals(72, proposals.length);+    }++    public void testCompletionWithWalrus2() throws Exception {+        String s;+        String original = "" ++                "while (x := 10) > 5:\n" ++                "  x.";+        s = StringUtils.format(original, "");+        ICompletionProposalHandle[] proposals = requestCompl(s, s.length(), -1,+                new String[] { "as_integer_ratio()", "bit_length()", "conjugate()", "denominator" });+        assertEquals(72, proposals.length);+    }++    public void testCompletionWithWalrus3() throws Exception {+        String s;+        String original = "" ++                "if x := 10:\n" ++                "  x.";+        s = StringUtils.format(original, "");+        ICompletionProposalHandle[] proposals = requestCompl(s, s.length(), -1,+                new String[] { "as_integer_ratio()", "bit_length()", "conjugate()", "denominator" });+        assertEquals(72, proposals.length);

You should not check how many proposals are there in total (this makes the test brittle as it's very likely it'll change in a new python release).

oluiscabral

comment created time in a day

PullRequestReviewEvent
PullRequestReviewEvent

push eventfabioz/PyDev.Debugger

Fabio Zadrozny

commit sha 64fc26509ff7e936d409264ea9925d99c9dfde7c

wip

view details

push time in 2 days

PR opened microsoft/debugpy

Reviewers
Show the full stack trace on user unhandled exceptions. Fixes #399
+4960 -4854

0 comment

16 changed files

pr created time in 2 days

create barnchfabioz/debugpy

branch : user_unhandled_399

created branch time in 2 days

push eventfabioz/PyDev.Debugger

Fabio Zadrozny

commit sha e0e8ea46c7c73b855d24108685059ed2969f5269

wip

view details

push time in 2 days

create barnchfabioz/PyDev.Debugger

branch : user_unhandled_399

created branch time in 3 days

push eventfabioz/PyDev.Debugger

Fabio Zadrozny

commit sha 5017c690f386599bd663e1e64c464e2ee15c76a2

wip

view details

push time in 3 days

issue commentmicrosoft/debugpy

Stack trace for user-unhandled exception does not reflect where it was raised

After testing a bit more I changed the structure to include a description in the exception name too (to hopefully make it even clearer).

image

vsfeedback

comment created time in 4 days

Pull request review commentfabioz/Pydev

Fix for #Pydev 1080: Conda activation must be improved

 @set "CONDA_PATH_BACKUP=%PATH%" @set "PATH=%CONDA_PREFIX%;%CONDA_PREFIX%\Scripts;%CONDA_PREFIX%\Library\bin;%PATH%" -@REM Run any activate scripts-@if exist "%CONDA_PREFIX%\etc\conda\activate.d" (-    @pushd "%CONDA_PREFIX%\etc\conda\activate.d"-    @for %%g in (*.bat) do @call "%%g"-    @popd+@REM activate conda and get the environment+@if exist "%CONDA_PREFIX%" (+	@call do conda activate %CONDA_PREFIX%+	@call do conda list

Why is conda list being called here?

oluiscabral

comment created time in 4 days

PullRequestReviewEvent
PullRequestReviewEvent

issue closedmicrosoft/debugpy

Duplicated tabs for same file when connecting through SSH

Issue Type: <b>Bug</b>

Expected behavior: no duplicated tabs opened, for a same file, when debugging

Steps to reproduce:

  1. Open VSCode remote session through "Remote - SSH" extension
  2. open workspace
  3. set launch configuration thusly
            {
                "name": "util.py",
                "type": "python",
                "request": "launch",
                "program": "util.py",
                "console": "integratedTerminal"
            },

(Note: issue not reproducible when running "Python: Current File" default configuration)

            {
                "name": "Python: Current File",
                "type": "python",
                "request": "launch",
                "program": "${file}",
                "console": "integratedTerminal"
            },
  1. open file, shows as /home/dario/centerNet-deep-sort/util.py
  2. set breakpoint
  3. run

Actual behavior: execution stops at breakpoint, but new tab opened of same file showing as in /mnt/home/centerNet-deep-sort/util.py (and breakpoint only visible in /home/centerNet-deep-sort/util.py file)

Extension version: 2020.9.111407 VS Code version: Code 1.49.1 (58bb7b2331731bf72587010e943852e13e6fd3cf, 2020-09-16T23:27:51.792Z) OS version: Windows_NT x64 10.0.19042 Remote OS version: Linux x64 4.15.0-117-generic

<details> <summary>System Info</summary>

Item Value
CPUs Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz (16 x 2400)
GPU Status 2d_canvas: enabled<br>flash_3d: enabled<br>flash_stage3d: enabled<br>flash_stage3d_baseline: enabled<br>gpu_compositing: enabled<br>multiple_raster_threads: enabled_on<br>oop_rasterization: disabled_off<br>opengl: enabled_on<br>protected_video_decode: enabled<br>rasterization: enabled<br>skia_renderer: disabled_off_ok<br>video_decode: enabled<br>vulkan: disabled_off<br>webgl: enabled<br>webgl2: enabled
Load (avg) undefined
Memory (System) 31.73GB (16.67GB free)
Process Argv --crash-reporter-id ff587ffc-1e1c-4420-a3e0-f2a2ab6938a5
Screen Reader no
VM 0%
Item Value
Remote SSH: 5.9.40.75
OS Linux x64 4.15.0-117-generic
CPUs Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz (8 x 3790)
Memory (System) 62.73GB (0.70GB free)
VM 0%

</details> <!-- generated by issue reporter -->

closed time in 4 days

WurmD

issue commentmicrosoft/debugpy

Duplicated tabs for same file when connecting through SSH

Great ;)

WurmD

comment created time in 4 days

issue commentmicrosoft/debugpy

Duplicated tabs for same file when connecting through SSH

It seems that the issue is that the util.py being executed doesn't have the full path frame and resolves to the working directory (that's actually /mnt/home/dario/centerNet-deep-sort and not /home/dario/centerNet-deep-sort).

i.e.: The logs shows the stack as:

  Stack: util.py, <module>, 4
  Stack: /home/dario/anaconda3/envs/CenterNet/lib/python3.6/runpy.py, _run_code, 85
  Stack: /home/dario/anaconda3/envs/CenterNet/lib/python3.6/runpy.py, _run_module_code, 96
  ....

So, it's possible to see that util.py doesn't really have the full path.

And it also says:

File traced: /mnt/home/dario/centerNet-deep-sort/util.py.

So, I think that you should have some pathMapping set to make that translation.

Something like:

            "pathMappings": [
                {
                    "localRoot": "/home/",
                    "remoteRoot": "/mnt/home/"
                }
            ],

(that should be added to the launch configuration)

WurmD

comment created time in 4 days

issue openedrobocorp/robotframework-lsp

Update Robocorp Code logo

created time in 4 days

Pull request review commentfabioz/Pydev

Fix for #Pydev 1080: Conda activation must be improved

 public void setEnvVariables(String[] env) {         if (!hasEnvVarsToUpdate && !this.activateCondaEnv) {             return env; //nothing to change         }+        Map<String, String> condaEnv = new HashMap<String, String>(this.condaEnv);

Please rename the this.condaEnv to this.condaEnvCache (so that it's clear that one is the cached version and the other is the local variable version to avoid name shadowing)

Also, please put this inside of this.activateCondaEnv as you don't need to access it unless you'll really need to use it (access to volatile is slower as it may need to synchronize threads, so, it should be used as little as possible).

oluiscabral

comment created time in 4 days

Pull request review commentfabioz/Pydev

Fix for #Pydev 1080: Conda activation must be improved

 public void setEnvVariables(String[] env) {         return ret;     } +    private Map<String, String> obtainCondaEnv(Map<String, String> condaEnv, Map<String, String> computedMap,+            File condaPrefix) throws IOException, CoreException {+        String[] cmdLine;+        File relativePath;+        Path loadVarsPath;+        if (PlatformUtils.isWindowsPlatform()) {+            loadVarsPath = new Path("helpers/load-conda-vars.bat");+            relativePath = CorePlugin.getBundleInfo().getRelativePath(loadVarsPath);+            cmdLine = new String[] { "cmd", "/c", relativePath.toString() };+        } else {+            loadVarsPath = new Path("helpers/load-conda-vars");+            relativePath = CorePlugin.getBundleInfo().getRelativePath(loadVarsPath);+            cmdLine = new String[] { relativePath.toString() };+        }+        Map<String, String> initialEnv = new HashMap<>(computedMap);+        initialEnv.put("__PYDEV_CONDA_PREFIX__", condaPrefix.toString());+        initialEnv.put("__PYDEV_CONDA_DEFAULT_ENV__", condaPrefix.getName());+        Process process = SimpleRunner.createProcess(cmdLine, createEnvWithMap(initialEnv),+                relativePath.getParentFile());+        Tuple<String, String> output = SimpleRunner.getProcessOutput(process,+                ProcessUtils.getArgumentsAsStr(cmdLine), null, null);+        for (String line : StringUtils.splitInLines(output.o1, false)) {+            if (!line.trim().isEmpty()) {+                Tuple<String, String> split = StringUtils.splitOnFirst(line, '=');+                if (split.o1.equals("__PYDEV_CONDA_PREFIX__")+                        || split.o1.equals("__PYDEV_CONDA_DEFAULT_ENV__")+                        || split.o1.equals("_")) {+                    continue;+                }+                condaEnv.put(split.o1, split.o2);+            }+        }+        return new HashMap<String, String>(condaEnv);

Since the condaEnv received is already a temporary, local created variable, you don't to return anything here... Actually, on 2nd thought, this code seems a bit weird to me... I think you shouldn't receive any parameter here for the condaEnv, just create the map inside of this function and return it here.

The caller can then cache the return as needed.

oluiscabral

comment created time in 4 days

PullRequestReviewEvent
PullRequestReviewEvent

issue commentmicrosoft/debugpy

Duplicated tabs for same file when connecting through SSH

Humm, I think that another option could be installing the debugger from master in the python interpreter you want to use:

i.e.: something as:

pip install https://github.com/microsoft/debugpy/archive/master.zip

(in this case the debugAdapterPath should not be needed)

WurmD

comment created time in 4 days

Pull request review commentfabioz/Pydev

[1096] Mark Skiped Tests as Skip in Overview

 def stopTest(self, test):         error_contents = ''         test_name = self.get_test_name(test) -         diff_time = '%.2f' % (end_time - self.start_time)-        if not self._current_errors_stack and not self._current_failures_stack:++        skipped = False+        outcome = getattr(test, '_outcome', None)+        if outcome is not None:+            skipped = bool(getattr(outcome, 'skipped', None)

Have you tested this locally? It seems to have a syntax error there...

herostrat

comment created time in 4 days

PullRequestReviewEvent
PullRequestReviewEvent

push eventfabioz/Pydev

Luis Cabral

commit sha 0af9950cb6f7125d4b29ec68759965b17e13719d

Handling colon in assignments and function declarations. Fixes #PyDev-1100

view details

push time in 4 days

issue closedmicrosoft/ptvsd

Debugger does not break when calling back from C created thread

<!-- Please search existing issues to avoid creating duplicates. -->

I have first open this bug in https://github.com/microsoft/vscode-python/issues/14098 - but maybe here it's more appropriate.

Environment data

  • Version: 1.49.0 (system setup)
  • Commit: e790b931385d72cf5669fcefc51cdf65990efa5d
  • Date: 2020-09-10T13:22:08.892Z
  • Electron: 9.2.1
  • Chrome: 83.0.4103.122
  • Node.js: 12.14.1
  • V8: 8.3.110.13-electron.0
  • OS: Windows_NT x64 10.0.19041
  • Extension version (available under the Extensions sidebar): v2020.8.109390
  • Python version (& distribution if applicable, e.g. Anaconda): 3.8.0
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): venv
  • Relevant/affected Python packages and their versions: none
  • Relevant/affected Python-related VS Code extensions and their versions: none
  • Value of the python.languageServer setting: Jedi

Expected behaviour

The debugger will break on the breakpoint set in VS Code.

Actual behaviour

The debugger does not break on the breakpoint set.

Steps to reproduce:

  1. Clone https://github.com/ido-ran/vscode-python-cthread-debugging
  2. Run create-venv.sh once to create venv
  3. Run build_thrd.sh to build Cyton extension
  4. Open test_threading.py in VS Code
  5. Add breakpoint on the print statement in handler function
  6. Start debug by pressing F5 or open the Run tab and click Start Debugging

closed time in 4 days

ido-ran

issue commentmicrosoft/ptvsd

Debugger does not break when calling back from C created thread

Yeap, using the pydevd api directly should also work for debugpy ;)

p.s.: I'm closing as this is a known issue which is being tracked elsewhere.

ido-ran

comment created time in 4 days

Pull request review commentfabioz/Pydev

Fix for #Pydev 1102: Code-completion does not work with walrus operator properly.

 public Object visitAssign(Assign node, int unpackPos) throws Exception {         return super.visitAssign(node);     } +    /**+     * @see org.python.pydev.parser.jython.ast.VisitorBase#visitNamedExpr(org.python.pydev.parser.jython.ast.NamedExpr)+     */+    @Override+    public Object visitNamedExpr(NamedExpr node) throws Exception {+        ILocalScope scope = new LocalScope(nature, this.defsStack);+        scope.setFoundAtASTNode(node);+        if (foundAsDefinition && !scope.equals(definitionFound.scope)) { //if it is found as a definition it is an 'exact' match, so, we do not keep checking it+            return null;+        }+        if (tokenToFind.equals(NodeUtils.getFullRepresentationString(node.target)) && node.value != null) {+            String rep = NodeUtils.getFullRepresentationString(node.value);+            if (rep != null && !rep.isEmpty()) {+                definitions+                        .add(getAssignDefinition(new Assign(null, node.value, null),

I think the only thing missing here is that you actually have the target in the NamedExpr, so, when constructing the Assign you should also pass the target.

i.e.: new Assign(new exprType[] {node.target}, node.value, null)

oluiscabral

comment created time in 4 days

PullRequestReviewEvent
PullRequestReviewEvent

issue commentmicrosoft/ptvsd

Debugger does not break when calling back from C created thread

This is a known issue...

We already tried some approaches and still haven't been able to come up with a good solution to do that in the general case, so, for now, you're required to manually ask for non-python started threads to be traced.

To do that you can use the following api:

import debugpy
debugpy.debug_this_thread()
ido-ran

comment created time in 4 days

pull request commentfabioz/Pydev

Patch 1

Thanks for the fix, just merged.

noberbaeumer

comment created time in 4 days

push eventfabioz/Pydev

noberbaeumer

commit sha accf34a16f1232adf655d651c7e3e3769b6c7de6

Fix searchExecutable for non Windows systems and the situation where the executable resides below a folder with the same name. Fix issue where the conda executable to be searchead is located as pymaven/conda/bin/conda. In which situation currently the folder pymaven/conda is returned and then tried to be executed.

view details

push time in 4 days

PR merged fabioz/Pydev

Patch 1

Fix searchExecutable for non Windows systems and the situation where the executable resides below a folder with the same name.

I myself had the issue, that the conda executable to be searchead is located as pymaven/conda/bin/conda. In which situation currently the folder pymaven/conda is returned and then tried to be executed.

+2 -1

0 comment

1 changed file

noberbaeumer

pr closed time in 4 days

issue commentmicrosoft/debugpy

Duplicated tabs for same file when connecting through SSH

The issue appears to be that the debugger currently resolves symlinks and considers a canonical version as it's possible to see that the debugger does:

Request for breakpoint in: /home/dario/nethra-scripts/download_images_from_json.py line: 42
Breakpoint (after path/source mapping) in: /mnt/home/dario/nethra-scripts/download_images_from_json.py line: 42

The latest master version actually had some fixes related on how this is handled internally so that internally we stop in a canonical place (even with symlinks resolved) but it reports the proper absolute (unresolved) path to the outside world.

Can you check with the current master to see if it fixes it for you?

It's something as:

git clone https://github.com/microsoft/debugpy.git
cd debugpy
pwd

Then, in your launch config add:

"debugAdapterPath": "<pwd path>/src/debugpy/adapter"

-- Note: I haven't tested if this works in the SSH case, so, if you have any issues there, please report back.

If it still doesn't work, can you provide the logs you have with the master version?

WurmD

comment created time in 4 days

Pull request review commentfabioz/Pydev

Fix for #Pydev 1097: Find references of constant does not find all references

 protected boolean getRecheckWhereDefinitionWasFound() {             String initialName, SourceModule module) {         SimpleNode searchStringsAt = module.getAst(); -        List<ASTEntry> ret = ScopeAnalysis.getLocalOccurrences(initialName, module.getAst());+        List<String> modNames = StringUtils.split(request.moduleName, '.');+        List<String> actualModNames = StringUtils.split(module.getName(), '.');+        FastStringBuffer buf = new FastStringBuffer();+        int i = 0;+        while (i < modNames.size() && i < actualModNames.size() && modNames.get(i).equals(actualModNames.get(i))) {+            i++;+        }+        while (i < modNames.size()) {+            buf.append(modNames.get(i)).append('.');+            i++;+        }+        buf.deleteLast();+        String compare = buf.toString();+        boolean valid = false;+        for (stmtType content : NodeUtils.getBody(searchStringsAt)) {

This doesn't seem ideal... there are a few reasons:

  1. You're doing a pre-check on the places to rename, but in case it matches it shouldn't switch the whether to find all parts (it could go on and create the entry directly).
  2. You're just visiting top-level imports (so, if there's an import inside a method it won't be gotten by this.

I think that the logic to check the import should be done inside of getLocalOccurrences itself when onlyFirstAttribPart==false (it's visitor structure should already visit children nodes).

oluiscabral

comment created time in 4 days

PullRequestReviewEvent
PullRequestReviewEvent

issue closedmicrosoft/ptvsd

Wrong when use vs code & ptvsd.py to debug a python file, which included python multiprocessing code

environment vs code == 1.49.1(windows) PTVSD == 4.3.2 python ==3.7.5 code environment= ubuntun and docker


When I try to use vs code and ptvsd.py to debug a python code, which included some multiprocessing.py part. The code will timeout when it goes to the multiprocessing part, and report: " Traceback (most recent call last): Error in atexit._run_exitfuncs: RuntimeError: already started" You can see the wrong detail WRONG TWO in the end.

After I saw some old issue, I try to add code multiprocessing.set_start_method('spawn',True) before using multiprocessing part But after I do that the vs code debug shows:“OSError: [Errno 98] Address already in use”

I think there are something wrong when I use both 'multiprocessing.set_start_method('spawn',True)' and ptvsd.enable_attach(address = ('0.0.0.0', 8888)) ptvsd_enable_attach(address) Because when I use vs code and ptvsd to debug a python code, which without multiprocessing everything works. And without vs code &PTVSD, the multiprocessing code works too. You can see the wrong detail WRONG TWO in the end.

____WRONG TWO Traceback (most recent call last):

During handling of the above exception, another exception occurred:

Exception in thread Thread-7: Traceback (most recent call last): File "/usr/lib/python3.7/threading.py", line 926, in _bootstrap_inner self.run() File "/usr/lib/python3.7/threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "/usr/lib/python3.7/multiprocessing/pool.py", line 412, in _handle_workers pool._maintain_pool() File "/usr/lib/python3.7/multiprocessing/pool.py", line 248, in _maintain_pool self._repopulate_pool() File "/usr/lib/python3.7/multiprocessing/pool.py", line 241, in _repopulate_pool w.start() File "/usr/lib/python3.7/multiprocessing/process.py", line 112, in start self._popen = self._Popen(self) File "/usr/lib/python3.7/multiprocessing/context.py", line 277, in _Popen return Popen(process_obj) File "/usr/lib/python3.7/multiprocessing/popen_fork.py", line 20, in init self._launch(process_obj) File "/usr/lib/python3.7/multiprocessing/popen_fork.py", line 70, in _launch self.pid = os.fork() File "/usr/local/lib/python3.7/dist-packages/ptvsd/_vendored/pydevd/_pydev_bundle/pydev_monkey.py", line 528, in new_fork _on_forked_process() File "/usr/local/lib/python3.7/dist-packages/ptvsd/_vendored/pydevd/_pydev_bundle/pydev_monkey.py", line 50, in _on_forked_process pydevd.settrace_forked() File "/usr/local/lib/python3.7/dist-packages/ptvsd/_vendored/pydevd/pydevd.py", line 2427, in settrace_forked patch_multiprocessing=True, File "/usr/local/lib/python3.7/dist-packages/ptvsd/_vendored/pydevd/pydevd.py", line 2179, in settrace wait_for_ready_to_run, File "/usr/local/lib/python3.7/dist-packages/ptvsd/_vendored/pydevd/pydevd.py", line 2230, in _locked_settrace debugger.connect(host, port) # Note: connect can raise error. File "/usr/local/lib/python3.7/dist-packages/ptvsd/_vendored/pydevd/pydevd.py", line 1060, in connect s = start_client(host, port) File "/usr/local/lib/python3.7/dist-packages/ptvsd/pydevd_hooks.py", line 136, in _start_client return start_client(daemon, h, p) File "/usr/local/lib/python3.7/dist-packages/ptvsd/_remote.py", line 62, in <lambda> start_client=(lambda daemon, h, port: start_daemon()), File "/usr/local/lib/python3.7/dist-packages/ptvsd/_remote.py", line 50, in start_daemon _, next_session = daemon.start_server(addr=(host, port)) File "/usr/local/lib/python3.7/dist-packages/ptvsd/daemon.py", line 158, in start_server with self.started(): File "/usr/lib/python3.7/contextlib.py", line 112, in enter return next(self.gen) File "/usr/local/lib/python3.7/dist-packages/ptvsd/daemon.py", line 110, in started self.start() File "/usr/local/lib/python3.7/dist-packages/ptvsd/daemon.py", line 145, in start raise RuntimeError('already started') RuntimeError: already started Unhandled exception in thread started by Unhandled exception in thread started by <_pydev_bundle.pydev_monkey._NewThreadStartupWithTrace object at 0x7efe4d55acd0>

____________WRONG TWO Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/lib/python3.7/multiprocessing/spawn.py", line 105, in spawn_main exitcode = _main(fd) File "/usr/lib/python3.7/multiprocessing/spawn.py", line 114, in _main prepare(preparation_data) File "/usr/lib/python3.7/multiprocessing/spawn.py", line 225, in prepare _fixup_main_from_path(data['init_main_from_path']) File "/usr/lib/python3.7/multiprocessing/spawn.py", line 277, in _fixup_main_from_path run_name="mp_main") File "/usr/lib/python3.7/runpy.py", line 263, in run_path pkg_name=pkg_name, script_name=fname) File "/usr/lib/python3.7/runpy.py", line 96, in _run_module_code mod_name, mod_spec, pkg_name, script_name) File "/usr/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/dingsh/LightGCN-restart-0826/code/main_dsh.py", line 22, in <module> ptvsd.enable_attach(address = ('0.0.0.0', 8888)) File "/usr/local/lib/python3.7/dist-packages/ptvsd/attach_server.py", line 101, in enable_attach ptvsd_enable_attach(address) File "/usr/local/lib/python3.7/dist-packages/ptvsd/_remote.py", line 79, in enable_attach patch_multiprocessing=ptvsd.options.multiprocess) File "/usr/local/lib/python3.7/dist-packages/ptvsd/_vendored/pydevd/pydevd.py", line 2179, in settrace wait_for_ready_to_run, File "/usr/local/lib/python3.7/dist-packages/ptvsd/_vendored/pydevd/pydevd.py", line 2230, in _locked_settrace debugger.connect(host, port) # Note: connect can raise error. File "/usr/local/lib/python3.7/dist-packages/ptvsd/_vendored/pydevd/pydevd.py", line 1060, in connect s = start_client(host, port) File "/usr/local/lib/python3.7/dist-packages/ptvsd/pydevd_hooks.py", line 136, in _start_client return start_client(daemon, h, p) File "/usr/local/lib/python3.7/dist-packages/ptvsd/_remote.py", line 62, in <lambda> start_client=(lambda daemon, h, port: start_daemon()), File "/usr/local/lib/python3.7/dist-packages/ptvsd/_remote.py", line 50, in start_daemon File "/usr/lib/python3.7/multiprocessing/spawn.py", line 277, in _fixup_main_from_path run_name="mp_main") File "/usr/lib/python3.7/runpy.py", line 263, in run_path pkg_name=pkg_name, script_name=fname) File "/usr/lib/python3.7/runpy.py", line 96, in _run_module_code mod_name, mod_spec, pkg_name, script_name) File "/usr/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/dingsh/LightGCN-restart-0826/code/main_dsh.py", line 22, in <module> ptvsd.enable_attach(address = ('0.0.0.0', 8888)) File "/usr/local/lib/python3.7/dist-packages/ptvsd/attach_server.py", line 101, in enable_attach ptvsd_enable_attach(address) File "/usr/local/lib/python3.7/dist-packages/ptvsd/_remote.py", line 79, in enable_attach patch_multiprocessing=ptvsd.options.multiprocess) File "/usr/local/lib/python3.7/dist-packages/ptvsd/_vendored/pydevd/pydevd.py", line 2179, in settrace wait_for_ready_to_run, File "/usr/local/lib/python3.7/dist-packages/ptvsd/_vendored/pydevd/pydevd.py", line 2230, in _locked_settrace debugger.connect(host, port) # Note: connect can raise error. File "/usr/local/lib/python3.7/dist-packages/ptvsd/_vendored/pydevd/pydevd.py", line 1060, in connect s = start_client(host, port) File "/usr/local/lib/python3.7/dist-packages/ptvsd/pydevd_hooks.py", line 136, in _start_client self._server = create_server(addr.host, addr.port) File "/usr/local/lib/python3.7/dist-packages/ptvsd/socket.py", line 79, in create_server Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/lib/python3.7/multiprocessing/spawn.py", line 105, in spawn_main exitcode = _main(fd) File "/usr/lib/python3.7/multiprocessing/spawn.py", line 114, in _main prepare(preparation_data) File "/usr/lib/python3.7/multiprocessing/spawn.py", line 225, in prepare _fixup_main_from_path(data['init_main_from_path']) File "/usr/lib/python3.7/multiprocessing/spawn.py", line 277, in _fixup_main_from_path run_name="mp_main") File "/usr/lib/python3.7/runpy.py", line 263, in run_path pkg_name=pkg_name, script_name=fname) File "/usr/lib/python3.7/runpy.py", line 96, in _run_module_code mod_name, mod_spec, pkg_name, script_name) File "/usr/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/dingsh/LightGCN-restart-0826/code/main_dsh.py", line 22, in <module> ptvsd.enable_attach(address = ('0.0.0.0', 8888)) File "/usr/local/lib/python3.7/dist-packages/ptvsd/attach_server.py", line 101, in enable_attach ptvsd_enable_attach(address) File "/usr/local/lib/python3.7/dist-packages/ptvsd/_remote.py", line 79, in enable_attach patch_multiprocessing=ptvsd.options.multiprocess) File "/usr/local/lib/python3.7/dist-packages/ptvsd/_vendored/pydevd/pydevd.py", line 2179, in settrace wait_for_ready_to_run, File "/usr/local/lib/python3.7/dist-packages/ptvsd/_vendored/pydevd/pydevd.py", line 2230, in _locked_settrace debugger.connect(host, port) # Note: connect can raise error. File "/usr/local/lib/python3.7/dist-packages/ptvsd/_vendored/pydevd/pydevd.py", line 1060, in connect s = start_client(host, port) File "/usr/local/lib/python3.7/dist-packages/ptvsd/pydevd_hooks.py", line 136, in _start_client return start_client(daemon, h, p) File "/usr/local/lib/python3.7/dist-packages/ptvsd/_remote.py", line 62, in <lambda> File "/usr/lib/python3.7/multiprocessing/spawn.py", line 105, in spawn_main exitcode = _main(fd) File "/usr/lib/python3.7/multiprocessing/spawn.py", line 114, in _main prepare(preparation_data) File "/usr/lib/python3.7/multiprocessing/spawn.py", line 225, in prepare _fixup_main_from_path(data['init_main_from_path']) File "/usr/lib/python3.7/multiprocessing/spawn.py", line 277, in _fixup_main_from_path run_name="mp_main") File "/usr/lib/python3.7/runpy.py", line 263, in run_path pkg_name=pkg_name, script_name=fname) File "/usr/lib/python3.7/runpy.py", line 96, in _run_module_code mod_name, mod_spec, pkg_name, script_name) File "/usr/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/dingsh/LightGCN-restart-0826/code/main_dsh.py", line 22, in <module> ptvsd.enable_attach(address = ('0.0.0.0', 8888)) File "/usr/local/lib/python3.7/dist-packages/ptvsd/attach_server.py", line 101, in enable_attach ptvsd_enable_attach(address) File "/usr/local/lib/python3.7/dist-packages/ptvsd/_remote.py", line 79, in enable_attach patch_multiprocessing=ptvsd.options.multiprocess) File "/usr/local/lib/python3.7/dist-packages/ptvsd/_vendored/pydevd/pydevd.py", line 2179, in settrace wait_for_ready_to_run, File "/usr/local/lib/python3.7/dist-packages/ptvsd/_vendored/pydevd/pydevd.py", line 2230, in _locked_settrace debugger.connect(host, port) # Note: connect can raise error. File "/usr/local/lib/python3.7/dist-packages/ptvsd/_vendored/pydevd/pydevd.py", line 1060, in connect s = start_client(host, port) File "/usr/local/lib/python3.7/dist-packages/ptvsd/pydevd_hooks.py", line 136, in _start_client File "/usr/lib/python3.7/multiprocessing/spawn.py", line 114, in _main prepare(preparation_data) File "/usr/lib/python3.7/multiprocessing/spawn.py", line 225, in prepare _fixup_main_from_path(data['init_main_from_path']) File "/usr/lib/python3.7/multiprocessing/spawn.py", line 277, in _fixup_main_from_path run_name="mp_main") File "/usr/lib/python3.7/runpy.py", line 263, in run_path pkg_name=pkg_name, script_name=fname) File "/usr/lib/python3.7/runpy.py", line 96, in _run_module_code mod_name, mod_spec, pkg_name, script_name) File "/usr/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/dingsh/LightGCN-restart-0826/code/main_dsh.py", line 22, in <module> ptvsd.enable_attach(address = ('0.0.0.0', 8888)) File "/usr/local/lib/python3.7/dist-packages/ptvsd/attach_server.py", line 101, in enable_attach ptvsd_enable_attach(address) File "/usr/local/lib/python3.7/dist-packages/ptvsd/_remote.py", line 79, in enable_attach patch_multiprocessing=ptvsd.options.multiprocess) File "/usr/local/lib/python3.7/dist-packages/ptvsd/_vendored/pydevd/pydevd.py", line 2179, in settrace wait_for_ready_to_run, File "/usr/local/lib/python3.7/dist-packages/ptvsd/_vendored/pydevd/pydevd.py", line 2230, in _locked_settrace debugger.connect(host, port) # Note: connect can raise error. File "/usr/local/lib/python3.7/dist-packages/ptvsd/_vendored/pydevd/pydevd.py", line 1060, in connect self._server = create_server(addr.host, addr.port) File "/usr/local/lib/python3.7/dist-packages/ptvsd/socket.py", line 79, in create_server server.bind((host, port)) OSError: [Errno 98] Address already in use

closed time in 5 days

Dingseewhole

issue commentmicrosoft/debugpy

Race condition failure when starting Debugger with python Gunicorn using virtual environment (venv) using VSCode & WSL

@gil0109 can you provide the logs for this?

To get the logs, set "logToFile": true in the launch.

I'm not sure where it puts them in the WSL case (when running in the terminal the path should appear when DEBUGPY_LOG_DIR is set, or you can print it from the program with: print(os.environ['DEBUGPY_LOG_DIR'])).

@int19h @brettcannon that output shows the venv activation being done at the end.

i.e.:

first command:
/usr/bin/env /mnt/c/git/queue-management/.venv/bin/python3 /home/gillani/.vscode-server/extensions/ms-python.python-2020.9.111407/pythonFiles/lib/python/debugpy/launcher 53413 -- /mnt/c/git/queue-management/.venv/bin/gunicorn wsgi --bind=0.0.0.0:5000 --access-logfile=- --config=/mnt/c/git/queue-management/api/gunicorn_config.py --timeout=9999 

second command:
source /mnt/c/git/queue-management/.venv/bin/activate

This seems backwards. I think that the venv activation is done by vscode-python (and not really debugpy)... right?

gil0109

comment created time in 5 days

issue commentmicrosoft/debugpy

Duplicated tabs for same file when connecting through SSH

@WurmD can you provide the logs for this?

To get the logs, set "logToFile": true in the launch.

I'm not sure where it puts them in the case for the ssh connection (when running in the terminal the path should appear when DEBUGPY_LOG_DIR is set, or you can print it from the program with: print(os.environ['DEBUGPY_LOG_DIR'])).

WurmD

comment created time in 5 days

issue commentmicrosoft/debugpy

Stack trace for user-unhandled exception does not reflect where it was raised

@int19h @karthiknadig @luabud

What do you think about the results below for this?

-- I'm marking with Current frame the place where the execution is actually stopped in the Call Stack and in the Exception Description to try to make it clear that the exception was raised at one place but the execution was actually stopped at a different frame.

image

Do you think this is clear? Also I'm showing User Uncaught Exceptions (should I commit that or do you want to roll that out differently?)

vsfeedback

comment created time in 5 days

Pull request review commentfabioz/Pydev

Fix for #Pydev 1080: Conda activation must be improved

 public void setEnvVariables(String[] env) {             return env; //nothing to change         } +        if (!this.condaEnv.isEmpty()) {

You should first put in a local var and then check for isEmpty to avoid racing conditions and then use that same variable in the createEnvWithMap.

oluiscabral

comment created time in 5 days

Pull request review commentfabioz/Pydev

Fix for #Pydev 1080: Conda activation must be improved

 public void setEnvVariables(String[] env) {             File condaPrefix = this.getCondaPrefix();             if (condaPrefix == null) {                 Log.log("Unable to find conda prefix for: " + this.getExecutableOrJar());-            } else if (new File(condaPrefix, "/etc/conda/activate.d").exists()) {+            } else if (new File(condaPrefix.getPath()).exists()) {

Actually I just saw that condaPrefix is already a File, so, you should just do: condaPrefix.exists().

oluiscabral

comment created time in 5 days

Pull request review commentfabioz/Pydev

Fix for #Pydev 1080: Conda activation must be improved

 public void setEnvVariables(String[] env) {                     Log.log(e);                 }             } else {-                Log.logInfo("Expected: " + new File(condaPrefix, "/etc/conda/activate.d")+                Log.logInfo("Expected: " + new File(condaPrefix.getPath())                         + " to exist to activate conda env.");             }         }         if (hasEnvVarsToUpdate) {             fillMapWithEnv(envVariables, computedMap, keysThatShouldNotBeUpdated, getStringVariableManager()); //will override the keys already there unless they're in keysThatShouldNotBeUpdated         } +        this.condaEnv = new HashMap<>(computedMap);

This shouldn't be here... you still have to compute the computedMap, you only want to create a map with the variables inside of this.activateCondaEnv (and then update computedMap with the variables of the condaEnv).

oluiscabral

comment created time in 5 days

Pull request review commentfabioz/Pydev

Fix for #Pydev 1080: Conda activation must be improved

 public void setEnvVariables(String[] env) {                     Log.log(e);                 }             } else {-                Log.logInfo("Expected: " + new File(condaPrefix, "/etc/conda/activate.d")+                Log.logInfo("Expected: " + new File(condaPrefix.getPath())

You don't need to create a File here, just use condaPrefix directly.

oluiscabral

comment created time in 5 days

PullRequestReviewEvent
PullRequestReviewEvent

create barnchfabioz/PyDev.Debugger

branch : user_handled_399

created branch time in 5 days

issue commentrobocorp/robotframework-lsp

Configuring and running linter tool together with LSP

Humm, I think it should be straightforward as RF already supports creating the AST in-memory (so, let me know if you need any help there as I can point you to the right direction).

i.e.: it doesn't seem it should be difficult to receive - and a --file parameter and return an InMemoryContentsWithPath object in https://github.com/MarketSquare/robotframework-robocop/blob/43ce30905df80db4616782b0267420488b723f70/robocop/run.py#L161 (it'd may need some instance checks later on, but looking at the code it seemed straightforward).

bhirsz

comment created time in 5 days

issue commentrobocorp/robotframework-lsp

robotframework-lsp does not recognize system directory separator ${/}

I agree it should recognize it, but I'll just note that that's a pretty strange use of the separator (as far as I know, you should be able to just use / there without any issues as you could just write Resource ../../XXX/XX/resource_XXX_general.robot).

That should work in Windows and Linux...

Miamaija

comment created time in 5 days

more