Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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.Compiler.Server.Shared" />
<InternalsVisibleTo Include="VisualFSharp.Salsa" />
<InternalsVisibleTo Include="VisualFSharp.UnitTests" />
Expand Down
13 changes: 6 additions & 7 deletions vsintegration/src/FSharp.LanguageService/GotoDefinition.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,20 @@
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

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 "")

let tagOfIdentToken = FSharpTokenTag.IDENT

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 +66,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 <> FSharpTokenTag.IDENT 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
Original file line number Diff line number Diff line change
Expand Up @@ -101,25 +101,6 @@ type UsingMSBuild() =
n
) 0


[<Test>]
member public this.``PublicSurfaceArea.DotNetReflection``() =
let ps = publicTypesInAsm @"FSharp.ProjectSystem.FSharp.dll"
Assert.AreEqual(1, ps) // BuildPropertyDescriptor
let ls = publicTypesInAsm @"FSharp.LanguageService.dll"
Assert.AreEqual(0, ls)
let compis = publicTypesInAsm @"FSharp.Compiler.Interactive.Settings.dll"
Assert.AreEqual(5, compis)
let compserver = publicTypesInAsm @"FSharp.Compiler.Server.Shared.dll"
Assert.AreEqual(0, compserver)
let lsbase = publicTypesInAsm @"FSharp.LanguageService.Base.dll"
Assert.AreEqual(0, lsbase)
let psbase = publicTypesInAsm @"FSharp.ProjectSystem.Base.dll"
Assert.AreEqual(17, psbase)
let fsi = publicTypesInAsm @"FSharp.VS.FSI.dll"
Assert.AreEqual(1, fsi)


[<Test>]
member public this.``ReconcileErrors.Test1``() =
let (_solution, project, file) = this.CreateSingleFileProject(["erroneous"])
Expand Down