├── .gitattributes
├── .gitignore
├── .paket
├── Paket.Restore.targets
├── paket.exe
├── paket.exe.config
└── paket.targets
├── .travis.yml
├── FSharp.Editing.sln
├── FSharp.Editing.userprefs
├── LICENSE.txt
├── README.md
├── RELEASE_NOTES.md
├── appveyor.yml
├── build.cmd
├── build.fsx
├── build.sh
├── global.json
├── paket.dependencies
├── paket.lock
├── scripts
├── GenNetcore.fsx
└── XLinq.fsx
├── src
├── FSharp.Editing.Client
│ ├── Client.fs
│ ├── FSharp.Editing.Client.fsproj
│ ├── Scripts
│ │ ├── Script.fsx
│ │ ├── load-project-debug.fsx
│ │ ├── load-project-release.fsx
│ │ ├── load-references-debug.fsx
│ │ └── load-references-release.fsx
│ └── paket.references
├── FSharp.Editing.Core
│ ├── AssemblyContentProvider.fs
│ ├── CodeAnalysisExtensions.fs
│ ├── CompilerLocationUtils.fs
│ ├── Constants.fs
│ ├── Extensions.fs
│ ├── FSharp.Editing.Core.fsproj
│ ├── IdentifierUtils.fs
│ ├── Lexer.fs
│ ├── Logging.fs
│ ├── Pervasive.fs
│ ├── ProjectFileInfo.fs
│ ├── QuickParse.fs
│ ├── Text.fs
│ ├── TypedAstUtils.fs
│ ├── UntypedAstUtils.fs
│ ├── Utils.fs
│ └── paket.references
├── FSharp.Editing.Messages
│ ├── AssemblyInfo.fs
│ ├── FSharp.Editing.Messages.fsproj
│ ├── Messages.fs
│ ├── Scripts
│ │ ├── Script1.fsx
│ │ ├── load-project-debug.fsx
│ │ ├── load-project-release.fsx
│ │ ├── load-references-debug.fsx
│ │ └── load-references-release.fsx
│ ├── Serialization.fs
│ ├── Utils.fs
│ └── paket.references
├── FSharp.Editing.ProjectInspector
│ ├── FSharp.Editing.ProjectInspector.fsproj
│ ├── ProfectFileInfo.fs
│ ├── Program.fs
│ └── paket.references
├── FSharp.Editing.Server
│ ├── AssemblyInfo.fs
│ ├── Context.fs
│ ├── FSharp.Editing.Server.fsproj
│ ├── Program.fs
│ ├── ProjectSystem.fs
│ ├── Service.fs
│ ├── Utilites.fs
│ └── paket.references
├── FSharp.Editing
│ ├── AssemblyInfo.fs
│ ├── CodeGeneration
│ │ ├── CodeGeneration.fs
│ │ ├── IndentedTextWriter.fs
│ │ ├── InterfaceStubGenerator.fs
│ │ ├── OpenDeclarationsGetter.fs
│ │ ├── RecordStubGenerator.fs
│ │ ├── SignatureGenerator.fs
│ │ ├── UnionPatternMatchCaseGenerator.fs
│ │ └── siggenv2.fs
│ ├── Coloring
│ │ ├── DepthParser.fs
│ │ ├── DocumentHighlights.fs
│ │ ├── HighlightUsageInFile.fs
│ │ ├── OpenDeclarationsGetter.fs
│ │ ├── PrintfSpecifiersUsageGetter.fs
│ │ └── UnopenedNamespacesResolver.fs
│ ├── Completion
│ │ ├── FileSystemCompletion.fs
│ │ └── SignatureHelp.fs
│ ├── Documentation
│ │ ├── XmlDocBuilder.fs
│ │ ├── XmlDocCache.fs
│ │ ├── XmlDocGenerator.fs
│ │ └── XmlDocParser.fs
│ ├── FSharp.Editing.fsproj
│ ├── FsLanguageService.fsx
│ ├── Navigation
│ │ ├── GoToDeclaration.fs
│ │ ├── GoToDefinition.fs
│ │ ├── GoToImplementation.fs
│ │ ├── GoToSignature.fs
│ │ ├── NavigableItemCache.fs
│ │ ├── NavigableItemsCollector.fs
│ │ ├── NavigateToIndex.fs
│ │ ├── NavigateToItem.fs
│ │ ├── NavigateToMetadata.fs
│ │ └── NavigateToReferenceSource.fs
│ ├── ProjectSystem
│ │ ├── FSharpWorkspace.fs
│ │ ├── FileSystem.fs
│ │ ├── FileSystemWatcher.fs
│ │ ├── HostServices.fs
│ │ ├── LanguageService.fs
│ │ ├── MSBuildEvaluation.fs
│ │ ├── OpenDocumentsTracker.fs
│ │ ├── ProjectConfig.fs
│ │ ├── ProjectSitesAndFiles.fs
│ │ ├── SolutionFileInfo.fs
│ │ └── SolutionProvider.fs
│ ├── Scratchpad.fsx
│ ├── Scripts
│ │ ├── load-project-debug.fsx
│ │ ├── load-project-release.fsx
│ │ ├── load-references-debug.fsx
│ │ └── load-references-release.fsx
│ ├── Structure
│ │ └── BlockStructure.fs
│ ├── Symbols
│ │ ├── QuickInfoProvider.fs
│ │ ├── SourceCodeClassifier.fs
│ │ └── SymbolHelpers.fs
│ └── paket.references
├── TestConsole
│ ├── AssemblyInfo.fs
│ ├── Program.fs
│ ├── TestConsole.fsproj
│ └── paket.references
└── netcore
│ ├── FSharp.Editing.Client
│ └── paket.references
│ ├── FSharp.Editing.Core
│ └── paket.references
│ ├── FSharp.Editing.Messages
│ └── paket.references
│ ├── FSharp.Editing.ProjectInspector
│ └── paket.references
│ ├── FSharp.Editing.Server
│ └── paket.references
│ ├── FSharp.Editing.netcore.sln
│ ├── FSharp.Editing
│ └── paket.references
│ └── TestConsole
│ └── paket.references
└── tests
├── FSharp.Editing.Tests
├── CodeGenerationTestInfrastructure.fs
├── DepthColorizerTests.fs
├── FSharp.Editing.Tests.fsproj
├── GetUsesOfSymbolInFileTests.fs
├── GoToDefinitionTests.LoadDirective.fs
├── GoToDefinitionTests.fs
├── IdentifierDetectionTests.fs
├── InterfaceStubGeneratorTests.fs
├── LanguageServiceTests.fs
├── LexerTests.fs
├── NavigableItemsCollectorTests.fs
├── NavigateToIndexTests.fs
├── OpenDeclarationsGetterTests.fs
├── OutliningTests.fs
├── PrintfSpecifiersUsageGetterTests.fs
├── RecordStubGeneratorTests.fs
├── RenameTests.fs
├── SymbolClassifierTests.fs
├── TestHelpers.fs
├── UnionPatternMatchCaseGeneratorTests.fs
├── UnopenedNamespacesResolverTests.fs
├── UnusedSymbolClassifierTests.fs
├── UtilsTests.fs
├── XmlDocTests.fs
└── paket.references
└── data
├── DepthColorizerSampleFile.fs
├── FSharpSignature
├── FSharpSignature.fsproj
├── Program.fs
├── Sample.fs
├── Sample.fsi
└── paket.references
├── InterfaceSampleFile.fs
├── LanguageServiceSampleFile.fs
├── MultiProjects
├── MultiProjects.sln
├── Project1.dll.mdb
├── Project1
│ ├── Project1.fsproj
│ ├── Project11.fs
│ └── paket.references
├── Project2.dll.mdb
└── Project2
│ ├── Project2.fsproj
│ ├── Project21.fs
│ └── paket.references
├── NavigateToSource
├── FAKETests.fs
├── NavigateToSource.fsproj
├── NavigateToSource.sln
├── OctokitTests.fs
└── paket.references
├── ParseLoadDirectives
├── includes
│ ├── a.fs
│ └── b.fs
└── test1.fsx
├── TypeProviderTests
├── DesignTimeURIs
│ └── 0CdPVqScGxbsHluW0KvuHpKSPow%3D.txt
├── FreebaseSchema
│ └── 0CdPVqScGxbsHluW0KvuHpKSPow%3D.txt
├── TypeProviderTests.fs
├── TypeProviderTests.fsproj
├── TypeProviderTests.sln
├── WorldBankSchema
│ └── 0CdPVqScGxbsHluW0KvuHpKSPow%3D.txt
└── paket.references
├── XmlDocSampleFile.fs
└── gotodef
├── generic-cases
├── adds-necessary-parenthesis-to-function-parameters
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── adds-necessary-parenthesis-to-tuple-parameters
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── double-backtick-identifiers-are-supported-1
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── double-backtick-identifiers-are-supported-2
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── double-backtick-identifiers-are-supported-3
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── double-backtick-identifiers-are-supported-4
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── double-backtick-identifiers-are-supported-5
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── double-backtick-identifiers-are-supported-6
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── double-backtick-identifiers-are-supported-7
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── double-backtick-identifiers-are-supported-8
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── go-to-abstract-class-definition-with-default-members
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── go-to-class-definition-with-events
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── go-to-constructor-less-struct-metadata
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── go-to-empty-class-metadata
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── go-to-empty-interface-metadata
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── go-to-empty-struct-metadata
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── go-to-enum-type-definition
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── go-to-f#-exception-definition-1
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── go-to-f#-exception-definition-2
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── go-to-f#-list-'t-definition
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── go-to-interface-definition
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── go-to-metadata-from-module-and-module-function-1
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── go-to-metadata-from-module-and-module-function-2
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── go-to-method-definition-generate-enclosing-type-metadata-and-supports-c#-events
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── go-to-non-abstract-class-definition-with-virtual-member
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── go-to-partial-active-patterns
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── go-to-property-definition-generate-enclosing-type-metadata
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── go-to-record-type-definition
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── go-to-struct-metadata
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── go-to-subclass-class-definition-with-override-members
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── go-to-total-active-patterns-should-display-enclosing-module-or-namespace
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── go-to-total-active-patterns
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── go-to-tuple-definition-1
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── go-to-tuple-definition-2
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── go-to-type-abbreviation-definition
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── go-to-type-definition-that-contains-c#-events
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── go-to-union-case
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── go-to-union-type-definition
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── handle-class-extension-members
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── handle-class-properties-with-setter
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── handle-delegates-1
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── handle-delegates-2
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── handle-double-backtick-identifiers-on-member-constraints-1
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── handle-double-backtick-identifiers-on-member-constraints-2
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── handle-generic-constraints-on-methods
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── handle-generic-constraints-on-module-functions-and-values-1
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── handle-generic-constraints-on-module-functions-and-values-2
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── handle-generic-constraints-on-type-1
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── handle-generic-constraints-on-type-2
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── handle-generic-constraints-on-type-3
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── handle-generic-constraints-on-type-4
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── handle-generic-constraints-on-type-5
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── handle-nested-modules
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── handle-optional-parameters
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── handle-property-method-attributes
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── handle-record-extension-members
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── handle-record-field-attributes
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── handle-statically-resolved-constraints-1
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── handle-statically-resolved-constraints-2
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── handle-statically-resolved-constraints-3
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── handle-statically-resolved-constraints-4
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── handle-union-case-attributes
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── handle-union-type-extension-members
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── members-are-sorted-this-way-abstract-member-member-static-member
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── operator-names-are-demangled
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── set-up-transitive-open-declarations-correctly
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
├── support-compiled-name-attribute
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
└── type-abbreviations-for-basic-types
│ ├── expected.fs
│ ├── input.fs
│ └── settings.json
└── generic-sample
└── settings.list.json
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Generated netcore projects
2 |
3 | src/netcore/**/app.config
4 | src/netcore/**/*.fsproj
5 |
6 | ## paket.references for generated projects should be tracked
7 | #!src/netcore/**/paket.references
8 | #!src/netcore/**/*.paket.references
9 |
10 |
11 | ## Ignore Visual Studio temporary files, build results, and
12 | ## files generated by popular Visual Studio add-ons.
13 |
14 | # User-specific files
15 | *.suo
16 | *.user
17 | *.sln.docstates
18 |
19 | # Roslyn cache directories
20 | *.ide
21 |
22 | # Build results
23 |
24 | [Dd]ebug/
25 | [Rr]elease/
26 | x64/
27 | build/
28 | [Bb]in/
29 | [Oo]bj/
30 |
31 | # Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets
32 | !packages/*/build/
33 |
34 | # MSTest test Results
35 | [Tt]est[Rr]esult*/
36 | [Bb]uild[Ll]og.*
37 |
38 | *_i.c
39 | *_p.c
40 | *.ilk
41 | *.meta
42 | *.obj
43 | *.pch
44 | *.pdb
45 | *.pgc
46 | *.pgd
47 | *.rsp
48 | *.sbr
49 | *.tlb
50 | *.tli
51 | *.tlh
52 | *.tmp
53 | *.tmp_proj
54 | *.log
55 | *.vspscc
56 | *.vssscc
57 | .builds
58 | *.pidb
59 | *.svclog
60 | *.scc
61 |
62 | # Visual C++ cache files
63 | ipch/
64 | *.aps
65 | *.ncb
66 | *.opensdf
67 | *.sdf
68 | *.cachefile
69 |
70 | # Visual Studio profiler
71 | *.psess
72 | *.vsp
73 | *.vspx
74 |
75 | # Guidance Automation Toolkit
76 | *.gpState
77 |
78 | # ReSharper is a .NET coding add-in
79 | _ReSharper*/
80 | *.[Rr]e[Ss]harper
81 |
82 | # TeamCity is a build add-in
83 | _TeamCity*
84 |
85 | # DotCover is a Code Coverage Tool
86 | *.dotCover
87 |
88 | # NCrunch
89 | *.ncrunch*
90 | .*crunch*.local.xml
91 |
92 | # Installshield output folder
93 | [Ee]xpress/
94 |
95 | # DocProject is a documentation generator add-in
96 | DocProject/buildhelp/
97 | DocProject/Help/*.HxT
98 | DocProject/Help/*.HxC
99 | DocProject/Help/*.hhc
100 | DocProject/Help/*.hhk
101 | DocProject/Help/*.hhp
102 | DocProject/Help/Html2
103 | DocProject/Help/html
104 |
105 | # Click-Once directory
106 | publish/
107 |
108 | # Publish Web Output
109 | *.Publish.xml
110 |
111 | # Enable nuget.exe in the .nuget folder (though normally executables are not tracked)
112 | !.nuget/NuGet.exe
113 |
114 | # Windows Azure Build Output
115 | csx
116 | *.build.csdef
117 |
118 | # Windows Store app package directory
119 | AppPackages/
120 |
121 | # Others
122 | sql/
123 | *.Cache
124 | ClientBin/
125 | [Ss]tyle[Cc]op.*
126 | ~$*
127 | *~
128 | *.dbmdl
129 | *.[Pp]ublish.xml
130 | *.pfx
131 | *.publishsettings
132 |
133 | # RIA/Silverlight projects
134 | Generated_Code/
135 |
136 | # Backup & report files from converting an old project file to a newer
137 | # Visual Studio version. Backup files are not needed, because we have git ;-)
138 | _UpgradeReport_Files/
139 | Backup*/
140 | UpgradeLog*.XML
141 | UpgradeLog*.htm
142 |
143 | # SQL Server files
144 | App_Data/*.mdf
145 | App_Data/*.ldf
146 |
147 |
148 | #LightSwitch generated files
149 | GeneratedArtifacts/
150 | _Pvt_Extensions/
151 | ModelManifest.xml
152 |
153 | # =========================
154 | # Windows detritus
155 | # =========================
156 |
157 | # Windows image file caches
158 | Thumbs.db
159 | ehthumbs.db
160 |
161 | # Folder config file
162 | Desktop.ini
163 |
164 | # Recycle Bin used on file shares
165 | $RECYCLE.BIN/
166 |
167 | # Mac desktop service store files
168 | .DS_Store
169 |
170 | # ===================================================
171 | # Exclude F# project specific directories and files
172 | # ===================================================
173 |
174 | # NuGet Packages Directory
175 | packages/
176 |
177 | # Generated documentation folder
178 | docs/output/
179 |
180 | # Temp folder used for publishing docs
181 | temp/
182 |
183 | # Test results produced by build
184 | TestResults.xml
185 |
186 | # Nuget outputs
187 | nuget/*.nupkg
188 | src/FSharpVSPowerTools/Properties/AssemblyInfo.cs
189 | *.orig
190 | paket-files
191 | *.xml
192 |
193 | release.cmd
194 | /src/*/Scripts/*
195 | tests/data/*/*.dll
196 | tests/data/*/*.xml
197 | tests/data/*/*.pdb
198 |
199 | _NCrunch_*
200 | build_PRIVATE.cmd
201 | gallerycredentials.txt
202 | .fake
203 |
204 | .vs/config/applicationhost.config
205 | *.FSharpLint
206 |
--------------------------------------------------------------------------------
/.paket/paket.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fsharp-editing/FSharp.Editing/d0324e7aafbf64a39d77d77296c4959ec0fdef8b/.paket/paket.exe
--------------------------------------------------------------------------------
/.paket/paket.exe.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.paket/paket.targets:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | true
7 | $(MSBuildThisFileDirectory)
8 | $(MSBuildThisFileDirectory)..\
9 | /Library/Frameworks/Mono.framework/Commands/mono
10 | mono
11 |
12 |
13 |
14 |
15 | $(PaketRootPath)paket.exe
16 | $(PaketToolsPath)paket.exe
17 | "$(PaketExePath)"
18 | $(MonoPath) --runtime=v4.0.30319 "$(PaketExePath)"
19 |
20 |
21 |
22 |
23 |
24 | $(MSBuildProjectFullPath).paket.references
25 |
26 |
27 |
28 |
29 | $(MSBuildProjectDirectory)\$(MSBuildProjectName).paket.references
30 |
31 |
32 |
33 |
34 | $(MSBuildProjectDirectory)\paket.references
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 | $(MSBuildProjectDirectory)\$(MSBuildProjectName).paket.references
47 | $(MSBuildProjectDirectory)\paket.references
48 | $(MSBuildStartupDirectory)\paket.references
49 | $(MSBuildProjectFullPath).paket.references
50 | $(PaketCommand) restore --references-files "$(PaketReferences)"
51 |
52 | RestorePackages; $(BuildDependsOn);
53 |
54 |
55 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: csharp
2 |
3 | sudo: false # use the new container-based Travis infrastructure
4 |
5 | script:
6 | - ./build.sh TravisCI
--------------------------------------------------------------------------------
/FSharp.Editing.userprefs:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # FSharp.Editing
2 |
3 | Cross Platform F# Editor Tooling Backend and F# Roslyn Workspace Services
4 |
--------------------------------------------------------------------------------
/RELEASE_NOTES.md:
--------------------------------------------------------------------------------
1 | #### 0.0.1 - 16.10.2016
2 |
--------------------------------------------------------------------------------
/appveyor.yml:
--------------------------------------------------------------------------------
1 | build_script:
2 | - ps: .\build.cmd
3 | test: off
4 | artifacts:
5 | - path: bin\*.vsix
--------------------------------------------------------------------------------
/build.cmd:
--------------------------------------------------------------------------------
1 | @echo off
2 |
3 | .paket\paket.exe restore
4 | if errorlevel 1 (
5 | exit /b %errorlevel%
6 | )
7 |
8 | packages\build\FAKE\tools\FAKE.exe build.fsx %*
--------------------------------------------------------------------------------
/build.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | if test "$OS" = "Windows_NT"
3 | then
4 | # use .Net
5 |
6 | .paket/paket.exe restore
7 | exit_code=$?
8 | if [ $exit_code -ne 0 ]; then
9 | exit $exit_code
10 | fi
11 |
12 | packages/build/FAKE/tools/FAKE.exe $@ --fsiargs -d:MONO build.fsx
13 | else
14 | # use mono
15 | mono .paket/paket.exe
16 | exit_code=$?
17 | if [ $exit_code -ne 0 ]; then
18 | certificate_count=$(certmgr -list -c Trust | grep X.509 | wc -l)
19 | if [ $certificate_count -le 1 ]; then
20 | echo "Couldn't download Paket. This might be because your Mono installation"
21 | echo "doesn't have the right SSL root certificates installed. One way"
22 | echo "to fix this would be to download the list of SSL root certificates"
23 | echo "from the Mozilla project by running the following command:"
24 | echo ""
25 | echo " mozroots --import --sync"
26 | echo ""
27 | echo "This will import over 100 SSL root certificates into your Mono"
28 | echo "certificate repository. Then try running the build script again."
29 | fi
30 | exit $exit_code
31 | fi
32 |
33 | mono packages/build/FAKE/tools/FAKE.exe $@ --fsiargs -d:MONO build.fsx
34 | fi
--------------------------------------------------------------------------------
/global.json:
--------------------------------------------------------------------------------
1 | {
2 | "sdk": {
3 | "version": "2.0.0-preview2-005840"
4 | }
5 | }
--------------------------------------------------------------------------------
/paket.dependencies:
--------------------------------------------------------------------------------
1 | source https://api.nuget.org/v3/index.json
2 | source https://dotnet.myget.org/F/roslyn/api/v3/index.json
3 |
4 |
5 | redirects: force
6 | content: none
7 | framework: >= net45
8 |
9 | nuget FSharp.Compiler.Service content: none
10 | nuget FSharp.Core redirects: force, content: none
11 | nuget Microsoft.Build >= 15.1
12 | nuget Microsoft.Build.Runtime >= 15.1
13 | nuget Newtonsoft.Json
14 | nuget Suave redirects: force
15 | nuget wire
16 | nuget Microsoft.Extensions.Logging.Abstractions
17 | nuget Microsoft.CodeAnalysis.Common >= 3.0.0-beta1-61613-05
18 | nuget Microsoft.CodeAnalysis.Features >= 3.0.0-beta1-61613-05
19 | nuget Microsoft.CodeAnalysis.Workspaces.Common >= 3.0.0-beta1-61613-05
20 |
21 | nuget FSharp.Management
22 | nuget FSharp.Data
23 |
24 |
25 | group netcore
26 | source https://api.nuget.org/v3/index.json
27 | source https://dotnet.myget.org/F/roslyn/api/v3/index.json
28 |
29 | redirects: on
30 | content: none
31 | framework: >= netstandard1.3
32 |
33 |
34 | nuget FSharp.NET.Sdk content: none
35 | nuget FSharp.Core
36 | nuget FSharp.Compiler.Service content: none
37 | nuget Suave redirects: force
38 |
39 | nuget System.Runtime
40 | nuget System.IO.FileSystem
41 | nuget System.IO.FileSystem.Watcher
42 | nuget System.IO.FileSystem.Primitives
43 | nuget System.Reflection.TypeExtensions
44 | nuget System.Xml.XDocument
45 |
46 | nuget Microsoft.CodeAnalysis.Common >= 3.0.0-beta1-61613-05
47 | nuget Microsoft.CodeAnalysis.Features >= 3.0.0-beta1-61613-05
48 | nuget Microsoft.CodeAnalysis.Workspaces.Common >= 3.0.0-beta1-61613-05
49 |
50 |
51 | nuget Microsoft.Build >= 15.1
52 | nuget Microsoft.Build.Runtime >= 15.1
53 | nuget Newtonsoft.Json
54 | nuget wire
55 |
56 | nuget Microsoft.Extensions.Logging.Abstractions
57 |
58 | nuget Microsoft.NETCore.DotNetHostPolicy
59 | nuget Microsoft.NETCore.Runtime.CoreCLR
60 |
61 | nuget System.Runtime.Loader
62 | nuget System.Runtime.Extensions
63 | nuget System.Runtime.InteropServices
64 | nuget System.Runtime.Serialization.Primitives
65 | nuget System.Runtime.InteropServices.RuntimeInformation
66 |
67 | nuget Microsoft.Extensions.Options.ConfigurationExtensions
68 | nuget Microsoft.Win32.Registry.AccessControl
69 |
70 |
71 | group Test
72 | content: none
73 | source https://api.nuget.org/v3/index.json
74 | redirects: on
75 |
76 | nuget NUnit
77 | nuget NUnit.Runners
78 | nuget FsCheck
79 |
80 | group Build
81 | source https://api.nuget.org/v3/index.json
82 | redirects: on
83 | content: none
84 |
85 | nuget FAKE
86 | nuget FSharp.Formatting
87 | github fsharp/FAKE modules/Octokit/Octokit.fsx
--------------------------------------------------------------------------------
/src/FSharp.Editing.Client/Client.fs:
--------------------------------------------------------------------------------
1 | namespace FSharp.Editing.Client
2 |
3 | open System.Threading
4 | open System.IO
5 | open System.Net
6 | open System
7 | open FSharp.Editing
8 | open FSharp.Editing.Messages
9 | open FSharp.Editing.Messages.Serialization
10 |
11 | type Client(serviceEndpoint: Uri) =
12 | let id = ref 0
13 |
14 | let copyAndClose (inputStream: Stream) =
15 | let readSize = 256
16 | let buffer = Array.zeroCreate readSize
17 | use ms = new MemoryStream()
18 | let mutable count = inputStream.Read (buffer, 0, readSize)
19 | while count > 0 do
20 | ms.Write(buffer, 0, count)
21 | count <- inputStream.Read(buffer, 0, readSize)
22 | ms.Position <- 0L
23 | inputStream.Flush ()
24 | inputStream.Dispose ()
25 | ms
26 |
27 | member __.Request<'a> (``method``: string, parameters: obj) : RequestResult<'a> =
28 | async {
29 | let id = Interlocked.Increment id
30 |
31 | let requestMessage =
32 | { RequestMessage.Id = id
33 | Jsonrpc = "2.0"
34 | Method = ``method``
35 | Params = parameters }
36 |
37 | let req = HttpWebRequest.Create serviceEndpoint
38 | req.Method <- "Post"
39 | req.ContentType <- "application/json-rpc"
40 | use! reqStream = req.GetRequestStreamAsync() |> Async.AwaitTask
41 | use writer = new StreamWriter (reqStream)
42 | let json = serialize requestMessage
43 | writer.Write json
44 | writer.Flush ()
45 | reqStream.Dispose ()
46 |
47 | let! resp = req.AsyncGetResponse()
48 | use respStream = resp.GetResponseStream()
49 | use reader = new StreamReader (copyAndClose respStream)
50 | let responseJson = reader.ReadToEnd()
51 | let response: ResponseWithId<'a> = Response.deserialize responseJson
52 | return
53 | match response.Result, response.Error with
54 | | _, Some error -> Fail error
55 | | Some result, _ -> Ok result
56 | | None, None ->
57 | Fail { ResponseError.Code = ErrorCode.InternalError
58 | Message = "Server returned inconsistent response. Either Result or Error must be filled."
59 | Data = null }
60 | }
61 |
62 | member this.ShowMessage (p: ShowMessageRequestParams) : RequestResult =
63 | this.Request (Request.Method.Initialize, p)
64 |
65 | //asyncChoice.Return { Title = "a title" }
--------------------------------------------------------------------------------
/src/FSharp.Editing.Client/Scripts/Script.fsx:
--------------------------------------------------------------------------------
1 | #load "load-project-debug.fsx"
2 |
3 | open FSharp.Editing.Messages
4 | open FSharp.Editing.Client
5 | open System
6 |
7 | let client = Client (Uri "http://127.0.0.1:8083")
8 |
9 | { Type = MessageType.Info
10 | Message = "foo"
11 | Actions = [] }
12 | |> client.ShowMessage
13 | |> Async.RunSynchronously
--------------------------------------------------------------------------------
/src/FSharp.Editing.Client/Scripts/load-project-debug.fsx:
--------------------------------------------------------------------------------
1 | // Warning: generated file; your changes could be lost when a new file is generated.
2 | #I __SOURCE_DIRECTORY__
3 | #load "load-references-debug.fsx"
4 | #load "../Client.fs"
5 |
--------------------------------------------------------------------------------
/src/FSharp.Editing.Client/Scripts/load-project-release.fsx:
--------------------------------------------------------------------------------
1 | // Warning: generated file; your changes could be lost when a new file is generated.
2 | #I __SOURCE_DIRECTORY__
3 | #load "load-references-release.fsx"
4 | #load "../AssemblyInfo.fs"
5 | "../Client.fs"
6 |
--------------------------------------------------------------------------------
/src/FSharp.Editing.Client/Scripts/load-references-debug.fsx:
--------------------------------------------------------------------------------
1 | // Warning: generated file; your changes could be lost when a new file is generated.
2 | #I __SOURCE_DIRECTORY__
3 | #r "System.Core.dll"
4 | #r "System.dll"
5 | #r "System.Numerics.dll"
6 | #r "../../../packages/Newtonsoft.Json/lib/net45/Newtonsoft.Json.dll"
7 | #r "../../../packages/System.IO.FileSystem/lib/net46/System.IO.FileSystem.dll"
8 | #r "../../../packages/System.IO.FileSystem.Primitives/lib/net46/System.IO.FileSystem.Primitives.dll"
9 | #r "../../../packages/System.Reflection.TypeExtensions/lib/net46/System.Reflection.TypeExtensions.dll"
10 | #r "../../../packages/System.Threading.Tasks.Extensions/lib/netstandard1.0/System.Threading.Tasks.Extensions.dll"
11 | #r "System.Xml.dll"
12 | #r "System.Xml.Linq.dll"
13 | #r "../../../packages/System.Xml.ReaderWriter/lib/net46/System.Xml.ReaderWriter.dll"
14 | #r "System.Runtime.Serialization.dll"
15 | #r "../../../packages/System.Runtime.Serialization.Primitives/lib/net46/System.Runtime.Serialization.Primitives.dll"
16 | #r "../../../build/Debug/FSharp.Editing.Core.dll"
17 | #r "../../../build/Debug/FSharp.Editing.Messages.dll"
18 | #r "../../../../../../../../Program Files (x86)/Reference Assemblies/Microsoft/Framework/.NETFramework/v4.6/Facades/System.Runtime.Serialization.Primitives.dll"
19 | #r "../../../../../../../../Program Files (x86)/Reference Assemblies/Microsoft/Framework/.NETFramework/v4.6/Facades/System.Xml.ReaderWriter.dll"
--------------------------------------------------------------------------------
/src/FSharp.Editing.Client/Scripts/load-references-release.fsx:
--------------------------------------------------------------------------------
1 | // Warning: generated file; your changes could be lost when a new file is generated.
2 | #I __SOURCE_DIRECTORY__
3 | #r "../../../packages/ExtCore/lib/net45/ExtCore.dll"
4 | #r "../../../packages/Newtonsoft.Json/lib/net45/Newtonsoft.Json.dll"
5 | #r "System.Core.dll"
6 | #r "System.dll"
7 | #r "System.Numerics.dll"
8 | #r "System.ComponentModel.Composition.dll"
9 | #r "../../../packages/System.IO.FileSystem/lib/net46/System.IO.FileSystem.dll"
10 | #r "../../../packages/System.IO.FileSystem.Primitives/lib/net46/System.IO.FileSystem.Primitives.dll"
11 | #r "../../../packages/System.Reflection.TypeExtensions/lib/net46/System.Reflection.TypeExtensions.dll"
12 | #r "../../../packages/System.Threading.Tasks.Extensions/lib/netstandard1.0/System.Threading.Tasks.Extensions.dll"
13 | #r "System.Xml.dll"
14 | #r "System.Xml.Linq.dll"
15 | #r "../../../packages/System.Xml.ReaderWriter/lib/net46/System.Xml.ReaderWriter.dll"
16 | #r "../../../../../../../../Program Files (x86)/Reference Assemblies/Microsoft/Framework/.NETFramework/v4.6.1/Facades/System.Xml.ReaderWriter.dll"
17 | #r "System.Runtime.Serialization.dll"
18 | #r "../../../packages/System.Runtime.Serialization.Primitives/lib/net46/System.Runtime.Serialization.Primitives.dll"
19 | #r "../../../../../../../../Program Files (x86)/Reference Assemblies/Microsoft/Framework/.NETFramework/v4.6.1/Facades/System.Runtime.Serialization.Primitives.dll"
20 | #r "../../../build/Release/FSharp.Editing.Messages.dll"
--------------------------------------------------------------------------------
/src/FSharp.Editing.Client/paket.references:
--------------------------------------------------------------------------------
1 | Newtonsoft.Json
2 | FSharp.Core
3 |
4 | group netcore
5 |
6 | System.IO.FileSystem
7 | System.IO.FileSystem.Primitives
8 | System.Reflection.TypeExtensions
9 | System.Runtime.Serialization.Primitives
10 |
--------------------------------------------------------------------------------
/src/FSharp.Editing.Core/IdentifierUtils.fs:
--------------------------------------------------------------------------------
1 | module FSharp.Editing.IdentifierUtils
2 |
3 | open System
4 | open Microsoft.FSharp.Compiler.PrettyNaming
5 | open Microsoft.FSharp.Compiler.SourceCodeServices.PrettyNaming
6 |
7 | let DoubleBackTickDelimiter = "``"
8 |
9 | let isDoubleBacktickIdent (s: string) =
10 | let doubledDelimiter = 2 * DoubleBackTickDelimiter.Length
11 | if s.StartsWith(DoubleBackTickDelimiter) && s.EndsWith(DoubleBackTickDelimiter) && s.Length > doubledDelimiter then
12 | let inner = s.Substring(DoubleBackTickDelimiter.Length, s.Length - doubledDelimiter)
13 | not (inner.Contains(DoubleBackTickDelimiter))
14 | else false
15 |
16 | let isIdentifier (s: string) =
17 | if isDoubleBacktickIdent s then
18 | true
19 | else
20 | s |> Seq.mapi (fun i c -> i, c)
21 | |> Seq.forall (fun (i, c) ->
22 | if i = 0 then IsIdentifierFirstCharacter c else IsIdentifierPartCharacter c)
23 |
24 | let isOperator (s: string) =
25 | let allowedChars = Set.ofList ['!'; '%'; '&'; '*'; '+'; '-'; '.'; '/'; '<'; '='; '>'; '?'; '@'; '^'; '|'; '~']
26 | (IsPrefixOperator s || IsInfixOperator s || IsTernaryOperator s)
27 | && (s.ToCharArray() |> Array.forall (fun c -> Set.contains c allowedChars))
28 |
29 | /// Encapsulates identifiers for rename operations if needed
30 | let encapsulateIdentifier symbolKind newName =
31 | let isKeyWord = List.exists ((=) newName) KeywordNames
32 | let isAlreadyEncapsulated = newName.StartsWith DoubleBackTickDelimiter && newName.EndsWith DoubleBackTickDelimiter
33 |
34 | if isAlreadyEncapsulated then newName
35 | elif (symbolKind = SymbolKind.Operator) || (symbolKind = SymbolKind.GenericTypeParameter) || (symbolKind = SymbolKind.StaticallyResolvedTypeParameter) then newName
36 | elif isKeyWord || not (isIdentifier newName) then DoubleBackTickDelimiter + newName + DoubleBackTickDelimiter
37 | else newName
38 |
39 | let isFixableIdentifier (s: string) =
40 | not (String.IsNullOrEmpty s) && encapsulateIdentifier SymbolKind.Ident s |> isIdentifier
41 |
42 | let private forbiddenChars = ["."; "+"; "$"; "&"; "["; "]"; "/"; "\\"; "*"; "\""]
43 |
44 | let isTypeNameIdent (s: string) =
45 | not (String.IsNullOrEmpty s) &&
46 | forbiddenChars |> Seq.forall (fun c -> not (s.Contains c)) &&
47 | isFixableIdentifier s
48 |
49 | let isUnionCaseIdent (s: string) =
50 | isTypeNameIdent s &&
51 | Char.IsUpper(s.Replace(DoubleBackTickDelimiter,"").[0])
--------------------------------------------------------------------------------
/src/FSharp.Editing.Core/paket.references:
--------------------------------------------------------------------------------
1 | FSharp.Compiler.Service
2 | Newtonsoft.Json
3 | wire
4 | FSharp.Core
5 | Microsoft.CodeAnalysis.Common
6 | Microsoft.CodeAnalysis.Workspaces.Common
7 | Microsoft.CodeAnalysis.Features
8 | Microsoft.Extensions.Logging.Abstractions
9 | System.Xml.ReaderWriter
10 |
11 |
--------------------------------------------------------------------------------
/src/FSharp.Editing.Messages/AssemblyInfo.fs:
--------------------------------------------------------------------------------
1 | // Auto-Generated by FAKE; do not edit
2 | namespace System
3 | open System.Reflection
4 |
5 | []
6 | []
7 | []
8 | []
9 | []
10 | do ()
11 |
12 | module internal AssemblyVersionInformation =
13 | let [] AssemblyTitle = "FSharp.Editing.Messages"
14 | let [] AssemblyProduct = "FSharp.Editing"
15 | let [] AssemblyDescription = "Rich F# language support for editors"
16 | let [] AssemblyVersion = "0.0.1"
17 | let [] AssemblyFileVersion = "0.0.1"
18 |
--------------------------------------------------------------------------------
/src/FSharp.Editing.Messages/Scripts/Script1.fsx:
--------------------------------------------------------------------------------
1 | #load "load-project-debug.fsx"
2 |
3 | open FSharp.Editing.Messages
4 | open FSharp.Editing.Messages.Serialization
5 |
6 | let msg: Message =
7 | Message.Request
8 | { Id = 25
9 | Request =
10 | Request.ShowMessage
11 | { Type = MessageType.Info
12 | Message = "a message"
13 | Actions =
14 | [ { Title = "a title 1" }
15 | { Title = "a title 2" } ] }}
16 |
17 | let json = Serializer.serialize msg
18 | printfn "%s" json
19 | let msg1 = Serializer.deserialize json
20 |
21 | #time
22 | let n = 500000
23 | for i in 1..n do Serializer.serialize msg |> ignore
24 | // Newtonsoft.Json (500000) Real: 00:00:02.011, CPU: 00:00:02.015, GC gen0: 356, gen1: 0, gen2: 0
25 | for i in 1..n do Serializer.deserialize json |> ignore
26 | // Newtonsoft.Json (500000) Real: 00:00:07.882, CPU: 00:00:07.890, GC gen0: 1854, gen1: 0, gen2: 0
27 |
--------------------------------------------------------------------------------
/src/FSharp.Editing.Messages/Scripts/load-project-debug.fsx:
--------------------------------------------------------------------------------
1 | // Warning: generated file; your changes could be lost when a new file is generated.
2 | #I __SOURCE_DIRECTORY__
3 | #load "load-references-debug.fsx"
4 | #load "../Utils.fs"
5 | "../Messages.fs"
6 | "../Serialization.fs"
7 |
--------------------------------------------------------------------------------
/src/FSharp.Editing.Messages/Scripts/load-project-release.fsx:
--------------------------------------------------------------------------------
1 | // Warning: generated file; your changes could be lost when a new file is generated.
2 | #I __SOURCE_DIRECTORY__
3 | #load "load-references-release.fsx"
4 | #load "../AssemblyInfo.fs"
5 | "../Utils.fs"
6 | "../Messages.fs"
7 | "../Serialization.fs"
8 |
--------------------------------------------------------------------------------
/src/FSharp.Editing.Messages/Scripts/load-references-debug.fsx:
--------------------------------------------------------------------------------
1 | // Warning: generated file; your changes could be lost when a new file is generated.
2 | #I __SOURCE_DIRECTORY__
3 | #r "System.Core.dll"
4 | #r "System.dll"
5 | #r "System.Numerics.dll"
6 | #r "../../../packages/Newtonsoft.Json/lib/net45/Newtonsoft.Json.dll"
7 | #r "../../../packages/System.IO.FileSystem/lib/net46/System.IO.FileSystem.dll"
8 | #r "../../../packages/System.IO.FileSystem.Primitives/lib/net46/System.IO.FileSystem.Primitives.dll"
9 | #r "../../../packages/System.Reflection.TypeExtensions/lib/net46/System.Reflection.TypeExtensions.dll"
10 | #r "../../../packages/System.Threading.Tasks.Extensions/lib/netstandard1.0/System.Threading.Tasks.Extensions.dll"
11 | #r "System.Xml.dll"
12 | #r "System.Xml.Linq.dll"
13 | #r "../../../packages/System.Xml.ReaderWriter/lib/net46/System.Xml.ReaderWriter.dll"
14 | #r "System.Runtime.Serialization.dll"
15 | #r "../../../packages/System.Runtime.Serialization.Primitives/lib/net46/System.Runtime.Serialization.Primitives.dll"
16 | #r "../../../build/Debug/FSharp.Editing.Core.dll"
17 | #r "../../../../../../../../Program Files (x86)/Reference Assemblies/Microsoft/Framework/.NETFramework/v4.6/Facades/System.Runtime.Serialization.Primitives.dll"
18 | #r "../../../../../../../../Program Files (x86)/Reference Assemblies/Microsoft/Framework/.NETFramework/v4.6/Facades/System.Xml.ReaderWriter.dll"
--------------------------------------------------------------------------------
/src/FSharp.Editing.Messages/Scripts/load-references-release.fsx:
--------------------------------------------------------------------------------
1 | // Warning: generated file; your changes could be lost when a new file is generated.
2 | #I __SOURCE_DIRECTORY__
3 | #r "../../../packages/Newtonsoft.Json/lib/net45/Newtonsoft.Json.dll"
4 | #r "System.Core.dll"
5 | #r "System.dll"
6 | #r "System.Numerics.dll"
7 | #r "System.ComponentModel.Composition.dll"
8 | #r "../../../packages/System.IO.FileSystem/lib/net46/System.IO.FileSystem.dll"
9 | #r "../../../packages/System.IO.FileSystem.Primitives/lib/net46/System.IO.FileSystem.Primitives.dll"
10 | #r "../../../packages/System.Reflection.TypeExtensions/lib/net46/System.Reflection.TypeExtensions.dll"
11 | #r "../../../packages/System.Threading.Tasks.Extensions/lib/netstandard1.0/System.Threading.Tasks.Extensions.dll"
12 | #r "System.Xml.dll"
13 | #r "System.Xml.Linq.dll"
14 | #r "../../../packages/System.Xml.ReaderWriter/lib/net46/System.Xml.ReaderWriter.dll"
15 | #r "../../../../../../../../Program Files (x86)/Reference Assemblies/Microsoft/Framework/.NETFramework/v4.6.1/Facades/System.Xml.ReaderWriter.dll"
16 | #r "System.Runtime.Serialization.dll"
17 | #r "../../../packages/System.Runtime.Serialization.Primitives/lib/net46/System.Runtime.Serialization.Primitives.dll"
18 | #r "../../../../../../../../Program Files (x86)/Reference Assemblies/Microsoft/Framework/.NETFramework/v4.6.1/Facades/System.Runtime.Serialization.Primitives.dll"
--------------------------------------------------------------------------------
/src/FSharp.Editing.Messages/Utils.fs:
--------------------------------------------------------------------------------
1 | []
2 | module FSharp.Editing.Utils
3 |
4 | let inline (|Ok|Fail|) x = match x with Choice1Of2 a -> Ok a | Choice2Of2 e -> Fail e
5 | let Ok = Choice1Of2
6 | let Fail = Choice2Of2
7 | let inline s fmt = sprintf fmt
--------------------------------------------------------------------------------
/src/FSharp.Editing.Messages/paket.references:
--------------------------------------------------------------------------------
1 | Newtonsoft.Json
2 | FSharp.Core
--------------------------------------------------------------------------------
/src/FSharp.Editing.ProjectInspector/Program.fs:
--------------------------------------------------------------------------------
1 | module FSharp.Editing.ProjectInspector.Program
2 | open System
3 | open System.IO
4 | open Microsoft.CodeAnalysis
5 | open Newtonsoft.Json
6 | open FSharp.Editing
7 | open FSharp.Editing.ProjectSystem
8 |
9 |
10 | []
11 | let main argv =
12 | // System.IO.Directory.SetCurrentDirectory __SOURCE_DIRECTORY__
13 |
14 | let target =
15 | if argv = [||] || String.IsNullOrWhiteSpace argv.[0] then
16 | Path.Combine(__SOURCE_DIRECTORY__, "../Fsharp.Editing.Client/FSharp.Editing.Client.fsproj")
17 | else argv.[0]
18 | if not (String.IsNullOrWhiteSpace target) then
19 | let fileInfo = FSharp.Editing.ProjectSystem.ProfectFileInfo.create target
20 |
21 | // Console.WriteLine "Hello from the child"
22 | // printfn "%A" fileInfo
23 | // Console.ReadLine()|>ignore
24 | // let writer = Serializer()
25 | // writer.Serialize(fileInfo,Console.OpenStandardOutput())
26 | // use writer = new StreamWriter(Console.OpenStandardOutput())
27 | // use jsonWriter = new JsonTextWriter(writer)
28 | // let ser = new JsonSerializer()
29 | // ser.Serialize(jsonWriter,fileInfo)
30 | // jsonWriter.Flush()
31 | let json = JsonConvert.SerializeObject(fileInfo)
32 | use writer = new StreamWriter( Console.OpenStandardOutput() )
33 | writer.WriteLine json
34 | writer.Flush()
35 | writer.Dispose()
36 | // Console.Write json
37 | // let ser = new DataContractJsonSerializer(typeof)
38 | // ser.WriteObject(Console.OpenStandardOutput(), fileInfo)
39 | // printfn "%A" fileInfo
40 | 0
41 | else
42 | 1
43 |
44 |
45 |
--------------------------------------------------------------------------------
/src/FSharp.Editing.ProjectInspector/paket.references:
--------------------------------------------------------------------------------
1 | FSharp.Core
2 | Microsoft.Build
3 | Microsoft.Build.Runtime
4 | FSharp.Compiler.Service
5 | Microsoft.CodeAnalysis.Common
6 | Microsoft.CodeAnalysis.Workspaces.Common
7 | Newtonsoft.Json
--------------------------------------------------------------------------------
/src/FSharp.Editing.Server/AssemblyInfo.fs:
--------------------------------------------------------------------------------
1 | // Auto-Generated by FAKE; do not edit
2 | namespace System
3 | open System.Reflection
4 |
5 | []
6 | []
7 | []
8 | []
9 | []
10 | do ()
11 |
12 | module internal AssemblyVersionInformation =
13 | let [] AssemblyTitle = "FSharp.Editing.Server"
14 | let [] AssemblyProduct = "FSharp.Editing"
15 | let [] AssemblyDescription = "Rich F# language support for editors"
16 | let [] AssemblyVersion = "0.0.1"
17 | let [] AssemblyFileVersion = "0.0.1"
18 |
--------------------------------------------------------------------------------
/src/FSharp.Editing.Server/Context.fs:
--------------------------------------------------------------------------------
1 | namespace FSharp.Editing.Server
2 |
3 | open FSharp.Editing
4 |
5 | []
6 | type Context =
7 | { Solution: Solution
8 | LanguageService: LanguageService }
9 |
10 |
--------------------------------------------------------------------------------
/src/FSharp.Editing.Server/Program.fs:
--------------------------------------------------------------------------------
1 | open System
2 | open System.IO
3 | open FSharp.Editing.Server
4 | open Suave
5 | open Suave.Operators
6 | open Suave.Filters
7 | open Suave.Successful
8 | open Suave.Writers
9 |
10 | []
11 | let main _ =
12 | POST
13 | >=> path "/"
14 | >=> Service.handle
15 | >=> setMimeType "application/json; charset=utf-8"
16 | |> startWebServer defaultConfig
17 | 0
--------------------------------------------------------------------------------
/src/FSharp.Editing.Server/ProjectSystem.fs:
--------------------------------------------------------------------------------
1 | namespace FSharp.Editing.Server
2 |
3 | open FSharp.Editing
4 | open Microsoft.FSharp.Compiler.SourceCodeServices
5 |
6 | []
7 | type Project =
8 | { FilePath: FilePath
9 | CompilerOptions: FSharpProjectOptions }
10 |
11 | []
12 | type Solution =
13 | { FileName: FileName option
14 | Projects: Map }
15 |
16 | //[]
17 | //module Solution =
18 | //let addOrUpdateProject project solution =
19 | //{ solution with Projects = solution.Projects |> Map.add project }
--------------------------------------------------------------------------------
/src/FSharp.Editing.Server/Service.fs:
--------------------------------------------------------------------------------
1 | namespace FSharp.Editing.Server
2 |
3 | open FSharp.Editing
4 | open FSharp.Editing.Messages
5 | open FSharp.Editing.Messages.Serialization
6 |
7 | module Service =
8 | open Suave
9 | open System.Text
10 |
11 | let private handleRequest (request: RequestWithId) : RequestResult =
12 | asyncChoice {
13 | match request.Request with
14 | | Request.ShowMessage _p ->
15 | return box { MessageActionItem.Title = "a title" }
16 | | Request.CodeLens _p ->
17 | return box
18 | [ { CodeLens.Command = None
19 | CodeLens.Range =
20 | { Start = { Line = 1; Character = 2 }
21 | End = { Line = 2; Character = 3 }}
22 | CodeLens.Data = None } ]
23 | | _ ->
24 | return!
25 | { Code = ErrorCode.MethodNotFound
26 | Message = s"%A is not supported." request.Request
27 | Data = null }
28 | |> Fail
29 | |> async.Return
30 | }
31 |
32 |
33 | let handle: WebPart = fun (ctx: HttpContext) ->
34 | async {
35 | let request =
36 | ctx.request.rawForm
37 | |> Encoding.UTF8.GetString
38 | |> Request.deserialize
39 |
40 | let! result = handleRequest request
41 |
42 | let response: ResponseWithId =
43 | match result with
44 | | Ok x ->
45 | { Id = request.Id
46 | Result = Some x
47 | Error = None }
48 | | Fail e ->
49 | { Id = request.Id
50 | Result = None
51 | Error = Some e }
52 |
53 | return! Response.response HttpCode.HTTP_200 (response |> Response.toMessage |> Json.toJson) ctx
54 | }
55 |
--------------------------------------------------------------------------------
/src/FSharp.Editing.Server/Utilites.fs:
--------------------------------------------------------------------------------
1 | []
2 | module FSharp.Editing.Server.Utilites
3 |
4 | open System
5 |
6 | module Logger =
7 | open Microsoft.FSharp.Core.Printf
8 |
9 | let debug msg = kprintf (fun x -> Console.WriteLine ((string DateTime.Now) + " [DEBUG] " + x)) msg
10 | let info msg = kprintf (fun x -> Console.WriteLine ((string DateTime.Now) + " [INFO] " + x)) msg
11 | let error msg = kprintf (fun x -> Console.WriteLine ((string DateTime.Now) + " [ERROR] " + x)) msg
12 |
13 | module Map =
14 | let addOrUpdate (key: 'k) (newValue: unit -> 'v) (update: 'v -> 'v) (m: Map<'k, 'v>) =
15 | match m |> Map.tryFind key with
16 | | Some oldV -> m |> Map.add key (update oldV)
17 | | None -> m |> Map.add key (newValue())
18 |
--------------------------------------------------------------------------------
/src/FSharp.Editing.Server/paket.references:
--------------------------------------------------------------------------------
1 | FSharp.Core
2 | FSharp.Compiler.Service
3 | Suave
4 |
5 | Microsoft.CodeAnalysis.Common
--------------------------------------------------------------------------------
/src/FSharp.Editing/AssemblyInfo.fs:
--------------------------------------------------------------------------------
1 | // Auto-Generated by FAKE; do not edit
2 | namespace System
3 | open System.Reflection
4 | open System.Runtime.CompilerServices
5 |
6 | []
7 | []
8 | []
9 | []
10 | []
11 | []
12 | do ()
13 |
14 | module internal AssemblyVersionInformation =
15 | let [] InternalsVisibleTo = "FSharp.Editing.Tests"
16 | let [] AssemblyTitle = "FSharp.Editing"
17 | let [] AssemblyProduct = "FSharp.Editing"
18 | let [] AssemblyDescription = "Rich F# language support for editors"
19 | let [] AssemblyVersion = "0.0.1"
20 | let [] AssemblyFileVersion = "0.0.1"
21 |
--------------------------------------------------------------------------------
/src/FSharp.Editing/Coloring/DocumentHighlights.fs:
--------------------------------------------------------------------------------
1 | namespace FSharp.Editing.Coloring
2 |
3 | open System
4 | open System.Collections.Immutable
5 | open System.Threading.Tasks
6 |
7 | open Microsoft.CodeAnalysis
8 | open Microsoft.CodeAnalysis.Text
9 |
10 | open Microsoft.FSharp.Compiler.SourceCodeServices
11 | open Microsoft.FSharp.Compiler.Range
12 | open FSharp.Editing
13 |
14 |
15 | module DocumentHighlights =
16 |
17 | []
18 | type FSharpHighlightSpan = {
19 | IsDefinition: bool
20 | TextSpan: TextSpan
21 | } with
22 | override this.ToString() = sprintf "%+A" this
23 |
24 |
25 | let fixInvalidSymbolSpans (sourceText: SourceText) (lastIdent: string) (spans: FSharpHighlightSpan []) =
26 | spans
27 | |> Seq.choose (fun (span: FSharpHighlightSpan) ->
28 | let newLastIdent = sourceText.GetSubText(span.TextSpan).ToString()
29 | let index = newLastIdent.LastIndexOf(lastIdent, StringComparison.Ordinal)
30 | if index > 0 then
31 | // Sometimes FCS returns a composite identifier for a short symbol, so we truncate the prefix
32 | // Example: newLastIdent --> "x.Length", lastIdent --> "Length"
33 | Some { span with TextSpan = TextSpan(span.TextSpan.Start + index, span.TextSpan.Length - index) }
34 | elif index = 0 && newLastIdent.Length > lastIdent.Length then
35 | // The returned symbol use is too long; we truncate its redundant suffix
36 | // Example: newLastIdent --> "Length<'T>", lastIdent --> "Length"
37 | Some { span with TextSpan = TextSpan(span.TextSpan.Start, lastIdent.Length) }
38 | elif index = 0 then
39 | Some span
40 | else
41 | // In the case of attributes, a returned symbol use may be a part of original text
42 | // Example: newLastIdent --> "Sample", lastIdent --> "SampleAttribute"
43 | let index = lastIdent.LastIndexOf(newLastIdent, StringComparison.Ordinal)
44 | if index >= 0 then
45 | Some span
46 | else None)
47 | |> Seq.distinctBy (fun span -> span.TextSpan.Start)
48 | |> Seq.toArray
49 |
50 |
51 | let getDocumentHighlights (checker: FSharpChecker, documentKey: DocumentId, sourceText: SourceText, filePath: string, position: int,
52 | defines: string list, options: FSharpProjectOptions, textVersionHash: int) : Async =
53 | asyncMaybe {
54 | let textLine = sourceText.Lines.GetLineFromPosition(position)
55 | let textLinePos = sourceText.Lines.GetLinePosition(position)
56 | let fcsTextLineNumber = Line.fromZ textLinePos.Line
57 | let! symbol = getSymbolAtPosition(documentKey, sourceText, position, filePath, defines, SymbolRangeLookup.Greedy)
58 | let! _, _, checkFileResults = checker.ParseAndCheckDocument(filePath, textVersionHash, sourceText.ToString(), options, allowStaleResults = true)
59 | let! symbolUse = checkFileResults.GetSymbolUseAtLocation(fcsTextLineNumber, symbol.Ident.idRange.EndColumn, textLine.ToString(), symbol.FullIsland)
60 | let! symbolUses = checkFileResults.GetUsesOfSymbolInFile(symbolUse.Symbol) |> liftAsync
61 | return
62 | [| for symbolUse in symbolUses do
63 | yield {
64 | IsDefinition = symbolUse.IsFromDefinition
65 | TextSpan = fsharpRangeToTextSpan sourceText symbolUse.RangeAlternate
66 | }
67 | |]
68 | |> fixInvalidSymbolSpans sourceText symbol.Ident.idText
69 | }
70 |
71 |
72 |
73 |
--------------------------------------------------------------------------------
/src/FSharp.Editing/Coloring/HighlightUsageInFile.fs:
--------------------------------------------------------------------------------
1 | namespace FSharp.Editing.Coloring
2 |
3 | open FSharp.Editing
4 | open Microsoft.CodeAnalysis
5 | open Microsoft.CodeAnalysis.Text
6 |
7 |
8 | module Symbols =
9 | open System.IO
10 |
11 | open Microsoft.FSharp.Compiler.SourceCodeServices
12 |
13 | let filterSymbolUsesDuplicates (uses: FSharpSymbolUse []) =
14 | uses
15 | |> Seq.map (fun symbolUse -> (symbolUse.FileName, symbolUse))
16 | |> Seq.groupBy (fst >> Path.GetFullPathSafe)
17 | |> Seq.collect (fun (_, symbolUses) ->
18 | symbolUses
19 | |> Seq.map snd
20 | |> Seq.distinctBy (fun s -> s.RangeAlternate))
21 | |> Seq.toArray
22 |
23 | type GetCheckResults = FileName -> Async
24 |
25 | module HighlightUsageInFile =
26 | open Microsoft.FSharp.Compiler.SourceCodeServices
27 |
28 | []
29 | type HighlightUsageInFileResult =
30 | | UsageInFile of FSharpSymbol * LongIdent * FSharpSymbolUse array
31 |
32 | let findUsageInFile file (currentLine: TextLine ) (symbol: Symbol) (getCheckResults: GetCheckResults) =
33 | asyncMaybe {
34 | let! parseAndCheckResults = getCheckResults file
35 | let! _ = parseAndCheckResults.GetSymbolUseAtLocation (currentLine.LineNumber, symbol.RightColumn, currentLine.ToString(), [symbol.Text])
36 | let! (symbol, ident, refs) = parseAndCheckResults.GetUsesOfSymbolInFileAtLocation (currentLine.LineNumber, symbol.RightColumn, currentLine.ToString(), symbol.Text)
37 | return UsageInFile (symbol, ident, Symbols.filterSymbolUsesDuplicates refs)
38 | }
--------------------------------------------------------------------------------
/src/FSharp.Editing/Coloring/PrintfSpecifiersUsageGetter.fs:
--------------------------------------------------------------------------------
1 | module FSharp.Editing.Coloring.PrintfSpecifiersUsageGetter
2 |
3 | open Microsoft.FSharp.Compiler
4 | open FSharp.Editing.UntypedAstUtils
5 | open FSharp.Editing
6 |
7 | []
8 | type PrintfSpecifierUse =
9 | { SpecifierRange: Range.range
10 | ArgumentRange: Range.range }
11 |
12 | let private startPos (r: Range.range) = r.StartLine, r.StartColumn
13 | let private endPos (r: Range.range) = r.EndLine, r.EndColumn
14 | let private mergeRanges (ranges : Range.range[]) =
15 | let startRange = ranges |> Array.minBy startPos
16 | let endRange = ranges |> Array.maxBy endPos
17 | Range.mkRange startRange.FileName startRange.Start endRange.End
18 |
19 | let getAll (input: ParseAndCheckResults) (onError: string -> unit): PrintfSpecifierUse[] option Async =
20 | asyncMaybe {
21 | let! specRangesAndArities = input.GetFormatSpecifierLocationsAndArity()
22 | let specRangesAndArities =
23 | specRangesAndArities
24 | |> Array.map (fun (x, ar) ->
25 | (Range.mkRange x.FileName x.Start (Range.mkPos x.EndLine (x.EndColumn))), ar)
26 |
27 | let printfFunctions = Printf.getAll input.ParseTree
28 |
29 | return
30 | printfFunctions
31 | |> Array.fold (fun (specRangesAndArities, acc) func ->
32 | let ownSpecifiers, restSpecifiers =
33 | specRangesAndArities
34 | |> Array.partition (fst >> (Range.rangeContainsRange func.FormatString))
35 |
36 | match ownSpecifiers with
37 | | [||] -> restSpecifiers, acc
38 | | _ ->
39 | let numSpecifierArgs = ownSpecifiers |> Array.sumBy snd
40 | if func.Args.Length > numSpecifierArgs then
41 | onError (sprintf "Too many Printf arguments for %+A (%d > %d)"
42 | func func.Args.Length numSpecifierArgs)
43 |
44 | let prioritizeArgPos pos =
45 | Array.partition (fun a -> Range.rangeBeforePos a pos)
46 | >> function (l, r) -> [| r |> Array.sortBy startPos
47 | l |> Array.sortBy startPos |]
48 | |> Array.concat
49 |
50 | let uses =
51 | let numUsedArgs = min func.Args.Length numSpecifierArgs
52 | let sortedOwnSpecifiers =
53 | ownSpecifiers |> Array.sortBy (fst>>startPos)
54 |
55 | let usedArgs =
56 | func.Args
57 | |> prioritizeArgPos (fst ownSpecifiers.[0]).Start
58 | |> function args -> args.[0..(numUsedArgs - 1)]
59 |
60 | let argChunks =
61 | usedArgs
62 | |> Array.splitByChunks (sortedOwnSpecifiers |> Array.map snd)
63 |
64 | let argChunkRanges =
65 | argChunks
66 | |> Array.filter (fun chunk -> chunk.Length > 0)
67 | |> Array.map mergeRanges
68 |
69 | let argAcceptingSpecifiers =
70 | sortedOwnSpecifiers
71 | |> Array.filter (fun (_, ar) -> ar > 0)
72 | |> function arr -> arr.[0..(argChunkRanges.Length - 1)]
73 |
74 | argChunkRanges
75 | |> Array.zip argAcceptingSpecifiers
76 | |> Array.map (fun ((spec, _), arg) -> { SpecifierRange = spec; ArgumentRange = arg })
77 | restSpecifiers, uses :: acc
78 | ) (specRangesAndArities, [])
79 | |> snd
80 | |> List.toArray
81 | |> Array.concat
82 | }
--------------------------------------------------------------------------------
/src/FSharp.Editing/Completion/FileSystemCompletion.fs:
--------------------------------------------------------------------------------
1 | module FileSystemCompletion
2 |
3 |
--------------------------------------------------------------------------------
/src/FSharp.Editing/Documentation/XmlDocCache.fs:
--------------------------------------------------------------------------------
1 | module FSharp.Editing.Documentation.XmlDocCache
2 |
3 |
4 |
5 | open System
6 | open System.Collections.Generic
7 | open System.Collections.Specialized
8 |
9 | open Microsoft.CodeAnalysis
10 | open Microsoft.CodeAnalysis.Text
11 | open Microsoft.CodeAnalysis.Differencing
12 |
13 | open FSharp.Editing
14 |
15 |
16 | (* The XML Sig info path generators are in ServiceDeclarations.fs
17 |
18 | - Processing the XML File (C# Programming Guide)
19 | - https://msdn.microsoft.com/en-us/library/fsbx0t7x.aspx
20 |
21 | - Recommended Tags for Documentation Comments (C# Programming Guide)
22 | - https://msdn.microsoft.com/en-us/library/5ast78ax.aspx
23 |
24 |
25 | - Mono.Documentation/monodocer.cs
26 | - https://github.com/mono/api-doc-tools/blob/master/mdoc/Mono.Documentation/monodocer.cs
27 |
28 |
29 |
30 | *)
--------------------------------------------------------------------------------
/src/FSharp.Editing/Documentation/XmlDocGenerator.fs:
--------------------------------------------------------------------------------
1 | module FSharp.Editing.Documentation.XmlDocGenerator
2 |
3 |
4 | // A command filter for the editor.
5 | // Command filters get an opportunity to observe and handle commands before and after the editor acts on them.
6 |
7 | open System
8 | open System.Diagnostics
9 | open System.Runtime.InteropServices
10 | open FSharp.Editing
11 | open FSharp.Editing.Documentation
12 | open Microsoft.CodeAnalysis
13 | open Microsoft.CodeAnalysis.Text
14 |
15 | //
16 | //let generateXmlDocStub (languageService:FSharpLanguageService) (typedChar:char) (position:LinePosition) (source:SourceText) (filePath:string) =
17 | // match typedChar with
18 | // | ('/' | '<') as lastChar ->
19 | // let curLine = source.GetLineAtPosition position
20 | // let lineWithLastCharInserted = curLine.InsertString(position.Character,string typedChar)
21 | //
22 | // match XmlDocComment.isBlank lineWithLastCharInserted with
23 | // | Some i when i = position.Character ->
24 | // asyncMaybe {
25 | //
26 | // let! doc = languageService.Workspace.TryGetDocument filePath
27 | // let! options languageService.Workspace.Pr
28 | // // XmlDocable line #1 are 1-based, editor is 0-based
29 | // let! parseResults = languageService.ParseFileInProject (fileName, project)
30 | //// let! source = languageService.Workspace.get
31 | // let! xmlDocables = XmlDocParser.getXmlDocables (source, parseResults.ParseTree) |> liftAsync
32 | // let xmlDocablesBelowThisLine =
33 | // // +1 because looking below current line for e.g. a 'member'
34 | // xmlDocables |> List.filter (fun (XmlDocable(line,_indent,_paramNames)) -> line = curLineNum+1)
35 | // match xmlDocablesBelowThisLine with
36 | // | [] -> ()
37 | // | XmlDocable(_line,indent,paramNames)::_t ->
38 | // // delete the slashes the user typed (they may be indented wrong)
39 | // wpfTextView.TextBuffer.Delete(wpfTextView.Caret.Position.BufferPosition.GetContainingLine().Extent.Span) |> ignore
40 | // // add the new xmldoc comment
41 | // let toInsert = new System.Text.StringBuilder()
42 | // toInsert.Append(' ', indent).AppendLine("/// ")
43 | // .Append(' ', indent).AppendLine("/// ")
44 | // .Append(' ', indent).Append("/// ") |> ignore
45 | // paramNames
46 | // |> List.iter (fun p ->
47 | // toInsert.AppendLine().Append(' ', indent).Append(sprintf "/// " p) |> ignore)
48 | // let _newSS = wpfTextView.TextBuffer.Insert(wpfTextView.Caret.Position.BufferPosition.Position, toInsert.ToString())
49 | // // move the caret to between the summary tags
50 | // let lastLine = wpfTextView.Caret.Position.BufferPosition.GetContainingLine()
51 | // let middleSummaryLine = wpfTextView.TextSnapshot.GetLineFromLineNumber(lastLine.LineNumber - 1 - paramNames.Length)
52 | // wpfTextView.Caret.MoveTo(wpfTextView.GetTextViewLineContainingBufferPosition(middleSummaryLine.Start)) |> ignore
53 | // }
54 | // |> Async.Ignore
55 | // |> Async.StartImmediateSafe
56 | // | Some _ | None -> ()
57 | // | _ -> ()
58 | //passThruToEditor.Exec(&pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut)
59 | //
60 | //member __.QueryStatus(pguidCmdGroup: byref, cCmds: uint32, prgCmds: OLECMD [], pCmdText: IntPtr) =
61 | //passThruToEditor.QueryStatus(ref pguidCmdGroup, cCmds, prgCmds, pCmdText)
62 | //
63 | //
64 |
--------------------------------------------------------------------------------
/src/FSharp.Editing/FsLanguageService.fsx:
--------------------------------------------------------------------------------
1 | System.IO.Directory.SetCurrentDirectory __SOURCE_DIRECTORY__
2 |
3 | #r "../../packages/FSharp.Compiler.Service/lib/net45/FSharp.Compiler.Service.dll"
4 | #r "../../packages/Microsoft.CodeAnalysis.Common/lib/netstandard1.3/Microsoft.CodeAnalysis.dll"
5 | #r "../../packages/Microsoft.CodeAnalysis.Features/lib/netstandard1.3/Microsoft.CodeAnalysis.Features.dll"
6 | #r "../../packages/Microsoft.CodeAnalysis.Workspaces.Common/lib/net46/Microsoft.CodeAnalysis.Workspaces.Desktop.dll"
7 | #r "../../packages/Microsoft.CodeAnalysis.Workspaces.Common/lib/net46/Microsoft.CodeAnalysis.Workspaces.dll"
8 | #r "../../packages/Wire/lib/net45/Wire.dll"
9 | #r "../FSharp.Editing.Core/bin/Release/FSharp.Editing.Core.dll"
10 | #r "bin/release/FSharp.Editing.dll"
11 |
12 | open Microsoft.CodeAnalysis
13 | open Microsoft.CodeAnalysis.Text
14 | open FSharp.Editing
15 | open System.IO
16 | open FSharp.Editing.ProjectSystem
17 | open Wire
18 |
19 |
20 | let inspectorPath = "../Fsharp.Editing.ProjectInspector/bin/Release/Fsharp.Editing.ProjectInspector.exe"
21 | let clientFsproj = "../Fsharp.Editing.Client/FSharp.Editing.Client.fsproj"
22 | let fsprojPath = Path.GetFullPath clientFsproj
23 | let inspectorTool = Path.GetFullPath inspectorPath
24 |
25 |
26 | let p = new System.Diagnostics.Process()
27 | p.StartInfo.FileName <- inspectorPath
28 | p.StartInfo.Arguments <- fsprojPath
29 | p.StartInfo.UseShellExecute <- false
30 | p.StartInfo.CreateNoWindow <- true
31 | p.StartInfo.RedirectStandardOutput <- true
32 | ignore <| p.Start()
33 |
34 | let ser = Serializer()
35 | let info = ser.Deserialize(p.StandardOutput.BaseStream)
36 | let fsls = FSharpLanguageService()
37 | //let fsproj = ProjectFileInfo.create "../Fsharp.Editing.Client/FSharp.Editing.Client.fsproj"
38 | //let fsproj = ProjectFileInfo.create "../Fsharp.Editing.Client/FSharp.Editing.Client.fsproj"
39 |
40 | let proj = fsls.Workspace.AddProject info
41 |
42 | fsls.Workspace.CurrentSolution.Projects
43 | |> Seq.iter (fun x -> printfn "%s - %s" x.Name x.AssemblyName)
44 |
45 |
46 |
--------------------------------------------------------------------------------
/src/FSharp.Editing/Navigation/GoToDeclaration.fs:
--------------------------------------------------------------------------------
1 | module FSharp.Editing.Navigation.GoToDeclaration
2 |
3 |
--------------------------------------------------------------------------------
/src/FSharp.Editing/Navigation/GoToDefinition.fs:
--------------------------------------------------------------------------------
1 | module FSharp.Editing.Navigation.GoToDefinition
2 |
3 | open System
4 | open System.Linq
5 | open System.Collections.Generic
6 | open System.Collections.Immutable
7 |
8 | open System.Threading
9 | open System.Threading.Tasks
10 |
11 | open Microsoft.CodeAnalysis
12 | open Microsoft.CodeAnalysis.Text
13 |
14 | open Microsoft.FSharp.Compiler.Range
15 | open Microsoft.FSharp.Compiler.SourceCodeServices
16 | open FSharp.Editing
17 | open FSharp.Editing.ProjectSystem
18 |
19 | let findDefinition
20 | ( checker: FSharpChecker
21 | , documentKey: DocumentId
22 | , sourceText: SourceText
23 | , filePath: string
24 | , position: int
25 | , defines: string list
26 | , options: FSharpProjectOptions
27 | , textVersionHash: int
28 | ) : Async