Skip to content

Commit

Permalink
Merged PR 457048: Download nuget package for server
Browse files Browse the repository at this point in the history
Download nuget package for server
  • Loading branch information
dibarbet committed Mar 9, 2023
1 parent e48f2e2 commit 72b8093
Show file tree
Hide file tree
Showing 61 changed files with 194 additions and 2,829 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ bin
obj
node_modules
out
artifacts
.roslyn/
.omnisharp/
.omnisharp-*/
.vs/
Expand Down
3 changes: 0 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
"outFiles": [
"${workspaceRoot}/dist/*.js"
],
"env": {
"ROSLYN_LANGUAGE_SERVER_DIRECTORY": "artifacts/bin/Debug/net7.0"
},
"preLaunchTask": "buildDev"
},
{
Expand Down
34 changes: 34 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
## Local development

### Pre-requisites

First install:

* Node.js (8.11.1 or later)
* Npm (5.6.0 or later)

### Build and run the extension

To run and develop the extension do the following:

* Run `npm i`
* Run `npm i -g gulp`
* Run `gulp roslyn:languageserver` (this will download the Roslyn language server executables as specified by the version in the [package.json](package.json))
* _Optional:_ run `gulp razor:languageserver` to install the Razor language server.
* Open in Visual Studio Code (`code .`)
* _Optional:_ run `npm run watch`, make code changes
* Press <kbd>F5</kbd> to debug

To **test** do the following: `npm run test` or <kbd>F5</kbd> in VS Code with the "Launch Tests" debug configuration.

### Using a locally developed Roslyn server

https://github.com/dotnet/roslyn contains the server implementation. Follow the instructions there to build the repo as normal. Once built, the server executable will be located in the build output directory, typically

`$roslynRepoRoot/artifacts/bin/Microsoft.CodeAnalysis.LanguageServer/Debug/net7.0/Microsoft.CodeAnalysis.LanguageServer.exe`

depending on which configuration is built. Then, launch the extension here and change the VSCode setting `dotnet.server.path` to point to the Roslyn executable path you built above and restart the language server.

### Creating VSIXs

VSIXs can be created using the gulp command `gulp vsix:release:package`. This will create all the platform specific VSIXs that you can then install manually in VSCode.
11 changes: 11 additions & 0 deletions NuGet.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. -->
<configuration>
<packageSources>
<clear />
<add key="VS" value="https://devdiv.pkgs.visualstudio.com/_packaging/VS/nuget/v3/index.json" />
</packageSources>
<disabledPackageSources>
<clear />
</disabledPackageSources>
</configuration>
15 changes: 1 addition & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,20 +164,7 @@ Alternatively you could visit https://github.com/OmniSharp/omnisharp-vscode/issu

### Development

First install:

* Node.js (8.11.1 or later)
* Npm (5.6.0 or later)

To **run and develop** do the following:

* Run `npm ci`
* Run `npm run compile`
* Open in Visual Studio Code (`code .`)
* _Optional:_ run `npm run watch`, make code changes
* Press <kbd>F5</kbd> to debug

To **test** do the following: `npm run test` or <kbd>F5</kbd> in VS Code with the "Launch Tests" debug configuration.
See [CONTRIBUTING.md](CONTRIBUTING.md)

### License

Expand Down
24 changes: 14 additions & 10 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ stages:
jobs:
- job: Build_And_Test
steps:

# The server package is downloaded from NuGet
- task: NuGetAuthenticate@1

# Required for integration tests.
- task: UseDotNet@2
displayName: 'Install .NET Core SDKs'
inputs:
useGlobalJson: true
workingDirectory: server/

- script: dotnet test ./server/Microsoft.CodeAnalysis.LanguageServer.sln -warnaserror --configuration Release
displayName: 'Build and test Microsoft.CodeAnalysis.LanguageServer.sln'
version: '7.0.100'

- task: NodeTool@0
displayName: 'Install Node.js 15.x'
Expand All @@ -35,11 +36,7 @@ stages:
- script: npm run compile
displayName: 'Compile'

# Build ready to run server bits for all platforms. This only needs to be done for the main executable project.
- script: gulp 'server:publish' --configuration Release
displayName: 'Publish Microsoft.CodeAnalysis.LanguageServer'

- script: gulp 'vsix:release:package' --configuration Release
- script: gulp 'vsix:release:package'
displayName: 'Build VSIXs'

- script: /usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
Expand All @@ -54,6 +51,13 @@ stages:
- script: npm run test:artifacts
displayName: 'Run artifacts tests'

- task: PublishPipelineArtifact@1
condition: failed()
displayName: 'Upload integration test logs'
inputs:
targetPath: '$(Build.SourcesDirectory)/.vscode-test/user-data/logs'
artifactName: 'VSCode Test Logs'

- task: PublishPipelineArtifact@1
# Run the publish step so we have vsix's even if the tests fail.
condition: succeededOrFailed()
Expand Down
3 changes: 1 addition & 2 deletions offline.vscodeignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
!.debugger/**
.logs/**
.nyc_output/**
!.roslyn/**
!.omnisharp/**
!.razor/**
.rpt2_cache/**
Expand All @@ -10,8 +11,6 @@
coverage/**
out/**
server/**
artifacts/**
!artifacts/languageServer/**
src/**
tasks/**
test/**
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "csharp",
"publisher": "ms-dotnettools",
"version": "2.0.0",
"description": "C# for Visual Studio Code (powered by OmniSharp).",
"description": "C# for Visual Studio Code",
"displayName": "C#",
"author": "Microsoft Corporation",
"license": "SEE LICENSE IN RuntimeLicenses/license.txt",
Expand Down Expand Up @@ -35,6 +35,7 @@
}
},
"defaults": {
"roslyn": "4.6.0-3.23158.4",
"omniSharp": "1.39.4",
"razor": "7.0.0-preview.23067.5"
},
Expand Down
Loading

0 comments on commit 72b8093

Please sign in to comment.