Skip to content

Eclipse autocompletion support#9297

Merged
feerrenrut merged 8 commits into
nvaccess:masterfrom
francipvb:i5667
May 13, 2019
Merged

Eclipse autocompletion support#9297
feerrenrut merged 8 commits into
nvaccess:masterfrom
francipvb:i5667

Conversation

@francipvb

@francipvb francipvb commented Feb 19, 2019

Copy link
Copy Markdown
Contributor

Link to issue number:

Closes #5667

Summary of the issue:

The issue is that when writing code in the editor you need to focus the popup to know what items are on it. This aims to solve this particular problem.

Description of how this pull request fixes the issue:

It detects the popup and read the selected item as it changes.

This also includes a little script to read javadoc right from the editor.

I tried to avoid relations with the OS controls.

Testing performed:

I tested it against java and XML editors. It works well, but in XML it will not read any documentation.

Known issues with pull request:

  • Probably will not read documentation for other languages than java.

Change log entry:

Section: New features

  • Eclipse: Added support for autocompletion in code editor. Improve support for Eclipse #5667
    • Additionally, Javadoc information can be read with NVDA+d right from the editor when it is present.

@francipvb francipvb changed the title Eclipse: Now the autocompletion items are read from the code editor w… Eclipse autocompletion support Feb 19, 2019
Comment thread source/appModules/eclipse.py Outdated
Comment thread source/appModules/eclipse.py Outdated
francipvb added 3 commits May 7, 2019 09:50
* Rework of `EclipseTextArea.script_readDocumentation`.
* Moved all cleaning code to `EclipseTextArea.event_suggestionsClosed`.
* Revision of `SelectionItem.event_selection`.
* Misc: Some detailed comments.
@francipvb

Copy link
Copy Markdown
Contributor Author

CC @LeonarddeR

What do you think about trying this approach for Visual Studio?

Comment thread source/appModules/eclipse.py Outdated
if self.appModule.selectedItem and not self.appModule.selectedItem.name:
self.event_suggestionsClosed()
self.appModule.selectedItem = None
except:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What exceptions are likely here? Would logging something help when debugging this pathway?

Comment thread source/appModules/eclipse.py Outdated
braille.handler.handleReviewMove()
sayAllHandler.readText(sayAllHandler.CURSOR_REVIEW)

while obj:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you put this loop in a function with a name that describes what it is doing? In general I would like to see obj renamed to be more descriptive (and split into separate references where the intent is different) to describe what each is supposed to be.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only place where this code is used, so I don't know why split this into another function.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-use is one reason to split code up, another is to improve the readability. You can hide the details, and replace it with an expressive name. This reduces the number of variables a reader has to keep track of, and provides them with a higher level at which to read the code. This reduces the control flow in the function so the high level approach is more obvious.

Comment thread source/appModules/eclipse.py Outdated

# Fixme: I picked up this from UIA SuggestionItem
braille.handler.message(braille.getBrailleTextForProperties(name=self.name, role=self.role, position=self.positionInfo))
# Fixme: I picked up this from UIA SuggestionItem for rendering in braille.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding a description of what is wrong with the alternatives. Could you also add what is wrong with this approach? The "Fixme" text indicates that there is still a problem, but it is not clear what it is.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @feerrenrut,

No, I don't think that this is a problem. I just am unsure if this is the right way. If you consider this is the best and correct approach I can remove this comment.

I don't have a Braille display to test this.

Cheers,

francipvb added 3 commits May 13, 2019 07:44
* Splitted root and document objects.
* Removed the "Fixme" label in braille output.
@feerrenrut feerrenrut merged commit cffe362 into nvaccess:master May 13, 2019
@nvaccessAuto nvaccessAuto added this to the 2019.2 milestone May 13, 2019
feerrenrut added a commit that referenced this pull request May 13, 2019
@francipvb francipvb deleted the i5667 branch September 19, 2019 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve support for Eclipse

3 participants