Skip to content

Indentation is not reported by NVDA in Visual Studio 2022 #13574

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

Closed
akash07k opened this issue Apr 3, 2022 · 17 comments · Fixed by #13604
Closed

Indentation is not reported by NVDA in Visual Studio 2022 #13574

akash07k opened this issue Apr 3, 2022 · 17 comments · Fixed by #13604
Labels
app/visual-studio blocked/needs-external-fix p4 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority triaged Has been triaged, issue is waiting for implementation.
Milestone

Comments

@akash07k
Copy link

akash07k commented Apr 3, 2022

Steps to reproduce:

  1. Start NVDA.
  2. Press insert+control+d or go to NVDA settings/Document formatting settings.
  3. Tab to "Line indentation reporting" combo box and change the selection from off to speech or both speech and tone.
  4. Open Visual Studio 2022.
  5. Create a new project, (Any project type will work).
  6. Go to the any file in solution explorer by pressing alt+control+l.
  7. Click any of the file.
  8. Write some code with different levels of indentation.
  9. Navigate via arrow keys and observe.
  10. NVDA will read the code, but won't report the indentation, neither via speech, nor via tone.
  11. Please hear the attached video for the demo on the issue.

Actual behavior:

NVDA doesn't report the indentation in Visual Studio 2022
Please hear the attached video for the demo on the issue.

Expected behavior:

Indentation should be reported as per user's chosen setting.

System configuration

NVDA installed/portable/running from source:

Installed

NVDA version:

NVDA version alpha-25106,153f5004

Windows version:

Windows 11 22H2 Insiders Build 22581.200

Name and version of other software in use when reproducing the issue:

Visual Studio 2022

Other information about your system:

N/A

Other questions

Does the issue still occur after restarting your computer?

Yes, always.

Have you tried any other versions of NVDA? If so, please report their behaviors.

Happens with all the versions, tried many alpha snapshots as well as stable builds.

If NVDA add-ons are disabled, is your problem still occurring?

Yes, always.

Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?

Yes and it is not applicable.

B4a929e18343547328839eaf4768e4e9f637846018183538226_2022-04-03_22-20-37.mp4
@SeanTolstoyevski
Copy link

Also NVDA+F does not say the indentation level.

@akash07k
Copy link
Author

akash07k commented Apr 6, 2022 via email

@feerrenrut
Copy link
Contributor

@LeonarddeR are you able to reproduce this?

@LeonarddeR
Copy link
Collaborator

LeonarddeR commented Apr 12, 2022

This is a known issue in Visual Studio. You will have to disable line numbers in Visual Studio's settings.

  1. Open Visual Studio
  2. Go to the tools menu (alt+t)
  3. Select options
  4. In the categories tree view, expand the text editor node
  5. Select all languages
  6. Press tab until you reach the option to display line numbers
  7. Disable it
  8. Press ok to close the options.

@feerrenrut feerrenrut added p4 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority triaged Has been triaged, issue is waiting for implementation. labels Apr 12, 2022
@akash07k
Copy link
Author

@LeonarddeR
Yeah, I'm aware about that work around actually, but if we disable the line numbers in Visual Studio then it is not possible/easy for us to know the line numbers.
Even the line numbers checkbox inside NVDA document formatting also doesn't have any effect.

@LeonarddeR
Copy link
Collaborator

That's true, but it really is an issue in Visual Studio we can't work around. UIA has no native support to report line numbers.

@lukaszgo1
Copy link
Contributor

That's true, but it really is an issue in Visual Studio we can't work around. UIA has no native support to report line numbers.

UIA may not have a native way to report line numbers, but the main issue here is that NVDA fails to report indentation when line numbers are enabled. Given that JAWS can (and they're using UIA for the editor control for some time now) closing this issue which clearly is an NVDA one feels wrong to me.

@akash07k
Copy link
Author

@lukaszgo1 Absolutely, I'm completely with you on this.
Since JAWS is able to do it very well, I think NVDA can also do that.
I agree, may be some extra efforts/work arounds may be needed at NVDA's side,but it is certainly doable.
The only thing which is important is that NVDA should be able to report indentation levels even though the line numbers are enabled in visual studio.
@LeonarddeR
I think that issue should be reopened because it really impacts the productivity specially working with python.

@LeonarddeR LeonarddeR reopened this Apr 12, 2022
@LeonarddeR
Copy link
Collaborator

I agree that closing this issue was a bit too soon. Let's leave this open to investigate.

@akash07k
Copy link
Author

Thanks @LeonarddeR for reopening.

@LeonarddeR
Copy link
Collaborator

LeonarddeR commented Apr 12, 2022

I'm pretty curious how JAWS behaves for a line like this when line numbers are disabled in visual studio:
1 hello
In other words, a line that starts with a number, followed by 5 spaces and a word. Will it report no indentation or will it report 4 spaces of indentation for that line?

@SeanTolstoyevski
Copy link

@LeonarddeR I'm thinking out loud and wanted to share it with you.

The UIA and other Windows APIs eventually send NVDA the text with the focused text (in this case the line number and other code).
With the means at possibility, we can remove the line number from the beginning of the string sent to NVDA.

Here is an example:

1        Console.WriteLine("text");

We will convert String to this:

        Console.WriteLine("text");

Isn't it a viable idea?

@LeonarddeR
Copy link
Collaborator

LeonarddeR commented Apr 13, 2022

The indentation is detected by means of a regular expression. We could implement something that expands that expression with numbers at the start of the line for Visual Studio, but then there's still the issue of what happens if line numbers are off in Visual Studio and a line starts with a number and white space. NV Access has always been very reluctant in accepting fixes like this, since they simply are ugly workarounds that could easily introduce other issues we don't know about beforehand.
That's why I wondered about how JAWS behaves in this case, see #13574 (comment)

@LeonarddeR
Copy link
Collaborator

Actually, it looks like that a collapsed range at the start of a line will return the line number with a space. We should be able to separate the line number from the text that way.

@LeonarddeR
Copy link
Collaborator

Ugh I'm sorry again, this turned out to be so easy! See #13604

seanbudd pushed a commit that referenced this issue Apr 21, 2022
Closes #13574

Summary of the issue:
In Visual Studio, when line number reporting is enabled in VS itself, line numbers are part of the text. Therefore they are reported regardless of NVDA's line reporting settings. This also causes indentation reporting to fail.

Description of how this pull request fixes the issue:
This pr isolates the line number from the text and ensures that it is reported appropriately when line number reporting in NVDA is on.

Testing strategy:
With line reporting enabled in Visual studio

Ensure that line numbers are reported when enabled in NVDA
Ensure that line numbers are not reported when disabled in NVDA
@nvaccessAuto nvaccessAuto modified the milestone: 2022.2 Apr 21, 2022
@akash07k
Copy link
Author

sadly it is not fixed in #13604

@SeanTolstoyevski
Copy link

SeanTolstoyevski commented Apr 26, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app/visual-studio blocked/needs-external-fix p4 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority triaged Has been triaged, issue is waiting for implementation.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants