New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

toolbar button for "Jump to next syntax checking result" problem #1563

Closed
hobbsd opened this Issue May 20, 2016 · 7 comments

Comments

Projects
None yet
3 participants
@hobbsd

hobbsd commented May 20, 2016

Short Summary

Just clicking on the button works, but the dropdown function lists the results out of order sometimes and seems to consistently go to the wrong result when a result line is clicked on. This is with pylint results.

Steps to Reproduce

Open a python file with pylint checking turned on.

Expected results

Clicking on a result line in the dropdown should go to the corresponding line in the file.

Actual results

The cursor is place at the beginning of a different result line.

Platform Information

Komodo Edit, version 10.0.0, build 17209, platform win32-x86.
Built on Thu May 12 00:43:26 2016.

Additional Information

syntax-results-button

@cgchoffman

This comment has been minimized.

Member

cgchoffman commented May 20, 2016

@hobbsd is it arbitrary for you? Or is it jumping to the error AFTER the one you clicked? I'm seeing the latter. I'm in a JS file so it's not specific to Pylint.

@cgchoffman cgchoffman added this to the 10.0.1 milestone May 20, 2016

@cgchoffman cgchoffman self-assigned this May 20, 2016

@hobbsd

This comment has been minimized.

hobbsd commented May 20, 2016

Yes, it is going to the one after the expected one -- in the real list, though, not necessarily the one after in the dropdown button list. For example, in the screenshot above clicking the first result in the list (line 33) goes to line 78, which is next in line in the correctly sorted list. Click the second (line 1) and it goes to line 33.

Also, and maybe this should be a separate issue, it seems like clicking the button should focus the editor pane, as clicking a line in the syntax checking pane does.

@Naatan

This comment has been minimized.

Member

Naatan commented May 20, 2016

Reproduced, seems the menuitem click does not invoke the right line (it's invoking a different syntax error essentially).

Eg. if I have 2 syntax errors, one on line 5 and one on line 8, clicking on the line 5 one MIGHT give you the line 8 result. I say might because I did not see any consistency in which one it chooses to use.

@cgchoffman

This comment has been minimized.

Member

cgchoffman commented May 20, 2016

I've notice that "Jump to next" in the dropdown menu jumps two spots. That's using ko.lint.jumpToNextLintResult so i'm guessing this is related to view.lintBuffer.lintResults as apposed to the dynamic button code where i first started looking.

@Naatan

This comment has been minimized.

Member

Naatan commented May 20, 2016

Interesting, nice find @cgchoffman

@cgchoffman

This comment has been minimized.

Member

cgchoffman commented May 25, 2016

Update:
I investigated my theory above and I don't believe it's right any more. Here I get the current files lint results then move the editor cursor around to individual results positions as reported by the linter

var lintResults = require("ko/views").current().get().lintBuffer.lintResults;
var res = {}; 
var numResults = {};
// get results and save them
 lintResults.getResults(res, numResults)
var editor = require("ko/editor"); 
// move cursor to appropriate location
editor.setCursor({line: res.value[0].lineStart, ch:res.value[0].columnStart})
// this works fine

I also noted that the toplevel buttons function (just clicking the Syntax Checking dybutton) works properly but the popup menu equivalent doesn't (click popup menu arrow > Jump to Next Result) so now I suspect the dynamic button generation code.

@cgchoffman

This comment has been minimized.

Member

cgchoffman commented Jun 8, 2016

Waiting on followup with @Naatan to review the dyn-button sdk as it appears that events are bubbling up to elements that they should. Nathan is going to assist on this.

@Naatan Naatan self-assigned this Jun 8, 2016

@Naatan Naatan added the New label Jun 8, 2016

@Naatan Naatan closed this in c4bcb19 Jun 8, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment