Skip to content

Commit

Permalink
Add READMEs to VS project.
Browse files Browse the repository at this point in the history
  • Loading branch information
allisterb committed Feb 4, 2024
1 parent f8a25f2 commit a0fa3cb
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 7 deletions.
40 changes: 40 additions & 0 deletions src/Stratis.VS.StratisEVM/README.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@

commonmark.js dingus

clear permalink Smart punctuation
## Try CommonMark

You can try CommonMark here. This dingus is powered by
[commonmark.js](https://github.com/commonmark/commonmark.js), the
JavaScript reference implementation.

1. item one
2. item two
- sublist
- sublist

Preview
HTML
AST

<h2>About</h2>
<p>The StratisEVM extension provides support for developing Stratis Solidity smart contracts inside Visual Studio.</p>
<h2>Features</h2>
<ul>
<li>Uses <a href="https://github.com/juanfranblanco/vscode-solidity">vscode-solidity</a> language server</li>
<li>Integrates with Visual Studio &quot;Open Folder&quot;</li>
<li>Syntax highlighting</li>
<li>Intellisense</li>
<li>Linting</li>
<li>Compiling a Solidity file from inside Visual Studio</li>
</ul>
<h2>Requirements</h2>
<ul>
<li>Visual Stdio 2022</li>
<li>A recent version of <a href="https://nodejs.org/">Node.js</a></li>
</ul>
<h2>Usage</h2>
<p>Use the Visual Studio Open Folder... feature to open a folder with Solidity contracts.</p>
<p>The first time you open a folder with Solidity contracts the extension will install the necessary Node.js modules in the extension's private <code>node_modules</code> directory.
This will take a few seconds to complete so opening the folder will be slower than normal but after the modules are installed the first time, opening folders containing
Solidity contracts will be as usual.</p>
21 changes: 21 additions & 0 deletions src/Stratis.VS.StratisEVM/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## About
The StratisEVM extension provides support for developing Stratis Solidity smart contracts inside Visual Studio.

## Features
* Uses [vscode-solidity](https://github.com/juanfranblanco/vscode-solidity) language server
* Integrates with Visual Studio "Open Folder"
* Syntax highlighting
* Intellisense
* Linting
* Compiling a Solidity file from inside Visual Studio

## Requirements
* Visual Stdio 2022
* A recent version of [Node.js](https://nodejs.org/)

## Usage
Use the Visual Studio Open Folder... feature to open a folder with Solidity contracts.

The first time you open a folder with Solidity contracts the extension will install the necessary Node.js modules in the extension's private `node_modules` directory.
This will take a few seconds to complete so opening the folder will be slower than normal but after the modules are installed the first time, opening folders containing
Solidity contracts will be as usual.
10 changes: 5 additions & 5 deletions src/Stratis.VS.StratisEVM/SolidityLanguageClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,20 +152,20 @@ public async Task<Connection> ActivateAsync(CancellationToken token)
}
if (Directory.Exists(Path.Combine(Runtime.AssemblyLocation, "node_modules")) && File.Exists(Path.Combine(Runtime.AssemblyLocation, "node_modules", "solidity", "dist", "cli", "server.js")))
{
VSUtil.LogInfo("Stratis EVM", "VSCode Solidity language server present.");
VSUtil.LogInfo("Stratis EVM", "vscode-solidity language server present.");
}
else
{
VSUtil.ShowLogOutputWindowPane(ServiceProvider.GlobalProvider, "Stratis EVM");
VSUtil.LogInfo("Stratis EVM", "Installing VSCode Solidity language server...");
VSUtil.LogInfo("Stratis EVM", "Installing vscode-solidity language server...");
var output = await ThreadHelper.JoinableTaskFactory.RunAsync(InstallVSCodeSolidityLanguageServerAsync, JoinableTaskCreationOptions.LongRunning);
if (CheckRunCmdOutput(output, "Run `npm audit` for details."))
{
VSUtil.LogInfo("Stratis EVM", "VSCode Solidity language server installed.");
VSUtil.LogInfo("Stratis EVM", "vscode-solidity language server installed.");
}
else
{
VSUtil.LogError("Stratis EVM", "Could not install VSCode Solidity language server.");
VSUtil.LogError("Stratis EVM", "Could not install vscode-solidity language server.");
return null;
}
}
Expand Down Expand Up @@ -214,7 +214,7 @@ public Task AttachForCustomMessageAsync(JsonRpc rpc)

public Task<InitializationFailureContext> OnServerInitializeFailedAsync(ILanguageClientInitializationInfo initializationState)
{
string message = "Solidity language server failed to initialize.";
string message = "vscode-solidity language server failed to initialize.";
Error(message);
string exception = initializationState.InitializationException?.ToString() ?? string.Empty;
message = $"{message}\n {exception}";
Expand Down
5 changes: 5 additions & 0 deletions src/Stratis.VS.StratisEVM/Stratis.VS.StratisEVM.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="README.html">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="Resources\Commands.png" />
<Content Include="Resources\solidity_16x16.png" />
<Content Include="SolidityLanguageSettings.json">
Expand All @@ -75,6 +79,7 @@
<Content Include="package.json">
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<None Include="README.md" />
<None Include="source.extension.vsixmanifest">
<SubType>Designer</SubType>
</None>
Expand Down
2 changes: 1 addition & 1 deletion src/Stratis.VS.StratisEVM/StratisEVMPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ protected override async Task InitializeAsync(CancellationToken cancellationToke

if (!Directory.Exists(Path.Combine(Runtime.AssemblyLocation, "node_modules")) || !File.Exists(Path.Combine(Runtime.AssemblyLocation, "node_modules", "solidity", "dist", "cli", "server.js")))
{
VSUtil.LogInfo("Stratis EVM", "VSCode Solidity language server not present.");
VSUtil.LogInfo("Stratis EVM", "vscode-solidity language server not present.");
}

// When initialized asynchronously, the current thread may be a background thread at this point.
Expand Down
2 changes: 1 addition & 1 deletion src/Stratis.VS.StratisEVM/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC"
"license": "MIT"
}
2 changes: 2 additions & 0 deletions src/Stratis.VS.StratisEVM/source.extension.vsixmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
<Description xml:space="preserve">StratisEVM smart contracts extension</Description>
<MoreInfo>https://github.com/stratisdevex/Stratis.DevEx/tree/master/src/Stratis.VS.StratisEVM</MoreInfo>
<License>LICENSE.txt</License>
<GettingStartedGuide>README.html</GettingStartedGuide>
<Icon>StratisLogo64x64.png</Icon>
<PreviewImage>StratisLogo200x200.png</PreviewImage>
<Tags>stratis,ethereum, solidity, smart contracts</Tags>
<Preview>true</Preview>
</Metadata>
<Installation>
Expand Down

0 comments on commit a0fa3cb

Please sign in to comment.