Skip to content
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

Implement F1 HelpContextService #1966

Merged
merged 5 commits into from
Dec 14, 2016
Merged

Implement F1 HelpContextService #1966

merged 5 commits into from
Dec 14, 2016

Conversation

rojepp
Copy link
Contributor

@rojepp rojepp commented Dec 8, 2016

Initial stab at implementing #1938

f1help

I haven't yet deleted any of the old F1 help code or tests.
I've copied all existing unit tests. I am not sure how much I can delete. :/

Two tests involving type providers and assembly references are commented out, all others pass.

@dsyme
Copy link
Contributor

dsyme commented Dec 8, 2016

Fabulous. Really fabulous!

content = "." -> true
| _ -> false

let keyword =
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a helper we can use here instead, like tryClassifyAtPosition? #1964 may be relevant.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I missed that one, thanks. It's not quite applicable here because it doesn't give back the categories that are needed here. But the code helped me do a small cleanup.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good.

@cartermp
Copy link
Contributor

cartermp commented Dec 8, 2016

Super happy to see this! I think we can leave the old F1 help code for now. Once we ship RTM of Visual Studio, one of the tasks we'll have is to delete all the dead code in the old language service. #1679 is tracking that.

@dsyme
Copy link
Contributor

dsyme commented Dec 8, 2016

Once we ship RTM of Visual Studio, one of the tasks we'll have is to delete all the dead code in the old language service

Just a heads up that the really big challenge will be to bring across the massive amount of testing in VisualFsharp.Tests that sits on top of this code, all of which is valuable. This testing is currently exercising the old language service code, but that in turn exercises the FCS API. Direct FCS testing doesn't include many editor tests because there is so much testing via this route.

The testing should be adjusted to sit on top of either FCS directly, or on the unit-testable parts of FSharp.Editor.

We can afford to lose a little bit of the testing along the way. But there is really important stuff here that represents many man years of investment and crucial corner-case bugs in both FCS, the F# compiler itself and even type providers.

My guess is that moving this testing across is going to be a sufficiently large and boring job that we'll not see it done for some time.... :/ :)

@cartermp
Copy link
Contributor

cartermp commented Dec 8, 2016

Yup, agreed. Hmmm. Maybe I can spend some time on that this Christmas break.

@dsyme
Copy link
Contributor

dsyme commented Dec 8, 2016

@cartermp It's a horrible, horrible job, please don't :) Spend some time on F# Azure Notebooks intellisense instead :)

@dsyme dsyme closed this Dec 8, 2016
@dsyme dsyme reopened this Dec 8, 2016
@dsyme
Copy link
Contributor

dsyme commented Dec 8, 2016

Close/reopen to retrigger build

@vasily-kirichenko
Copy link
Contributor

Awesome. I may be wrong but I cannot remember F1 working ever, starting from VS 2012.

@rojepp
Copy link
Contributor Author

rojepp commented Dec 8, 2016

All old tests have been enabled now. I'm pretty sure the CI errors are because #1967 has not been merged.

@dsyme
Copy link
Contributor

dsyme commented Dec 8, 2016

Really good work especially on the tests. Can you delete the corresponding tests in the old test suite as part of this PR please? That will avoid someone duplicating the work later. thanks

@rojepp
Copy link
Contributor Author

rojepp commented Dec 8, 2016

Done. I didn't delete any of the old code though.

@rojepp
Copy link
Contributor Author

rojepp commented Dec 14, 2016

Rebased against master. Still works.

@rojepp rojepp changed the title WIP: implement F1 HelpContextService Implement F1 HelpContextService Dec 14, 2016
Copy link
Contributor

@cartermp cartermp left a comment

Choose a reason for hiding this comment

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

LGTM. Really looking forward to seeing this merged.

Copy link
Member

@KevinRansom KevinRansom left a comment

Choose a reason for hiding this comment

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

Looks good, apart from the c:\test.fs.

let (s', poslist') = extractPos 0 row s poslist
(row+1, (s'::lines),poslist')) (1,[],[]) testLines
List.rev l , List.rev p
let fileName = "C:\\test.fs"
Copy link
Member

Choose a reason for hiding this comment

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

absolute path and root of C? can we make it relative or use an environment variable or a temporary folder?

Copy link
Contributor

Choose a reason for hiding this comment

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

@KevinRansom I believe the file name is dummy. It is to create correct FSharpProjecOptions for testing. File contents are provided directly without reading from disks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That was my understanding too. This exists in other tests here, here.
ParseAndCheckFileInProject gets the source code as a string.

@KevinRansom
Copy link
Member

Then it probably doesn't need the path qualifier.

@KevinRansom
Copy link
Member

@rojepp
Thanks for taking care of this.

Kevin

nosami pushed a commit to xamarin/visualfsharp that referenced this pull request Jan 26, 2022
* WIP: implement F1 HelpContextService

Implements dotnet#1938

* Small cleanup

* Enable context help tests for provided types

* Delete old tests

* Rebase against master
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.

7 participants