Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@

<ItemGroup>
<InternalsVisibleTo Include="fsc" />
<InternalsVisibleTo Include="FSharp.LanguageService" />
<InternalsVisibleTo Include="FSharp.LanguageService.Base" />
<InternalsVisibleTo Include="FSharp.ProjectSystem.Base" />
<InternalsVisibleTo Include="FSharp.ProjectSystem.FSharp" />
<InternalsVisibleTo Include="FSharp.ProjectSystem.PropertyPages" />
Expand Down
20 changes: 13 additions & 7 deletions vsintegration/src/FSharp.LanguageService/GotoDefinition.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,27 @@
namespace Microsoft.VisualStudio.FSharp.LanguageService

open System
open System.IO
open System.Collections.Generic
open System.Diagnostics
open Microsoft.VisualStudio
open Microsoft.VisualStudio.Shell
open Microsoft.VisualStudio.Shell.Interop
open Microsoft.VisualStudio.TextManager.Interop
open FSharp.Compiler
open FSharp.Compiler.Lib
open FSharp.Compiler.SourceCodeServices

/// Contains the value this dead code uses from the internals of the parser.
/// Now this value is just a constant here; as the actual tag value is unlikely to ever change, and this entire file is dead code only active in legacy tests that we have yet to migrate.
module Constants =
[<Literal>]
let Parse_Ident_Tag_Value = 190

module internal OperatorToken =

let asIdentifier_DEPRECATED (token : TokenInfo) =
// Typechecker reports information about all values in the same fashion no matter whether it is named value (let binding) or operator
// here we piggyback on this fact and just pretend that we need data time for identifier
let tagOfIdentToken = FSharp.Compiler.Parser.tagOfToken(FSharp.Compiler.Parser.IDENT "")

// Dead code (aside from legacy tests), ignore
let tagOfIdentToken = Constants.Parse_Ident_Tag_Value

let endCol = token.EndIndex + 1 // EndIndex from GetTokenInfoAt points to the last operator char, but here it should point to column 'after' the last char
tagOfIdentToken, token.StartIndex, endCol

Expand Down Expand Up @@ -69,7 +73,9 @@ module internal GotoDefinition =
|> GotoDefinitionResult_DEPRECATED.MakeError
| Some(colIdent, tag, qualId) ->
if typedResults.HasFullTypeCheckInfo then
if Parser.tokenTagToTokenId tag <> Parser.TOKEN_IDENT then
// Used to be the Parser's internal definition, now hard-coded to avoid an IVT into the parser itsef.
// Dead code (aside from legacy tests), ignore
if tag <> Constants.Parse_Ident_Tag_Value then
Strings.GotoDefinitionFailed_NotIdentifier()
|> GotoDefinitionResult_DEPRECATED.MakeError
else
Expand Down
2 changes: 1 addition & 1 deletion vsintegration/src/FSharp.LanguageService/Intellisense.fs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ type internal FSharpDeclarations_DEPRECATED(documentationBuilder, declarations:
// We intercept this call only to get the initial extent
// of what was committed to the source buffer.
let result = decl.GetName(filterText, index)
FSharp.Compiler.Lexhelp.Keywords.QuoteIdentifierIfNeeded result
Keywords.QuoteIdentifierIfNeeded result

override decl.IsCommitChar(commitCharacter) =
// Usual language identifier rules...
Expand Down