diff --git a/src/Stratis.DevEx.sln b/src/Stratis.DevEx.sln index 738ee18..cb23573 100644 --- a/src/Stratis.DevEx.sln +++ b/src/Stratis.DevEx.sln @@ -98,8 +98,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cobra.Api", "..\ext\Cobra.A EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Stratis.DevEx.TestChain", "Stratis.DevEx.TestChain\Stratis.DevEx.TestChain.csproj", "{F18BA290-AFB9-4EEF-8281-30F3F32A0265}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stratis.VS.Solidity2", "Stratis.VS.Solidity2\Stratis.VS.Solidity2.csproj", "{6546214D-9FE1-4244-BC3E-2D7CA5A65194}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stratis.VS.StratisEVM", "Stratis.VS.StratisEVM\Stratis.VS.StratisEVM.csproj", "{99ED2062-8DD2-4969-972C-C9DC81EBF869}" EndProject Global @@ -637,24 +635,6 @@ Global {F18BA290-AFB9-4EEF-8281-30F3F32A0265}.Sources|arm64.Build.0 = Debug|Any CPU {F18BA290-AFB9-4EEF-8281-30F3F32A0265}.Sources|x86.ActiveCfg = Debug|Any CPU {F18BA290-AFB9-4EEF-8281-30F3F32A0265}.Sources|x86.Build.0 = Debug|Any CPU - {6546214D-9FE1-4244-BC3E-2D7CA5A65194}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6546214D-9FE1-4244-BC3E-2D7CA5A65194}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6546214D-9FE1-4244-BC3E-2D7CA5A65194}.Debug|arm64.ActiveCfg = Debug|arm64 - {6546214D-9FE1-4244-BC3E-2D7CA5A65194}.Debug|arm64.Build.0 = Debug|arm64 - {6546214D-9FE1-4244-BC3E-2D7CA5A65194}.Debug|x86.ActiveCfg = Debug|x86 - {6546214D-9FE1-4244-BC3E-2D7CA5A65194}.Debug|x86.Build.0 = Debug|x86 - {6546214D-9FE1-4244-BC3E-2D7CA5A65194}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6546214D-9FE1-4244-BC3E-2D7CA5A65194}.Release|Any CPU.Build.0 = Release|Any CPU - {6546214D-9FE1-4244-BC3E-2D7CA5A65194}.Release|arm64.ActiveCfg = Release|arm64 - {6546214D-9FE1-4244-BC3E-2D7CA5A65194}.Release|arm64.Build.0 = Release|arm64 - {6546214D-9FE1-4244-BC3E-2D7CA5A65194}.Release|x86.ActiveCfg = Release|x86 - {6546214D-9FE1-4244-BC3E-2D7CA5A65194}.Release|x86.Build.0 = Release|x86 - {6546214D-9FE1-4244-BC3E-2D7CA5A65194}.Sources|Any CPU.ActiveCfg = Debug|Any CPU - {6546214D-9FE1-4244-BC3E-2D7CA5A65194}.Sources|Any CPU.Build.0 = Debug|Any CPU - {6546214D-9FE1-4244-BC3E-2D7CA5A65194}.Sources|arm64.ActiveCfg = Debug|arm64 - {6546214D-9FE1-4244-BC3E-2D7CA5A65194}.Sources|arm64.Build.0 = Debug|arm64 - {6546214D-9FE1-4244-BC3E-2D7CA5A65194}.Sources|x86.ActiveCfg = Debug|x86 - {6546214D-9FE1-4244-BC3E-2D7CA5A65194}.Sources|x86.Build.0 = Debug|x86 {99ED2062-8DD2-4969-972C-C9DC81EBF869}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {99ED2062-8DD2-4969-972C-C9DC81EBF869}.Debug|Any CPU.Build.0 = Debug|Any CPU {99ED2062-8DD2-4969-972C-C9DC81EBF869}.Debug|arm64.ActiveCfg = Debug|arm64 @@ -710,7 +690,6 @@ Global {4546334C-3D5E-42DB-A017-22D3E931633F} = {A0717F4C-8EED-4659-B72F-50DB73E1F64E} {75785EBD-14DC-463A-AD50-ED046F39A5AC} = {A0717F4C-8EED-4659-B72F-50DB73E1F64E} {F18BA290-AFB9-4EEF-8281-30F3F32A0265} = {8DC77034-0F3C-40E6-A352-B157BCB85462} - {6546214D-9FE1-4244-BC3E-2D7CA5A65194} = {3244104A-4F62-488E-8DA9-B1FEB2E367E7} {99ED2062-8DD2-4969-972C-C9DC81EBF869} = {3244104A-4F62-488E-8DA9-B1FEB2E367E7} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution diff --git a/src/Stratis.VS.Solidity2/CustomCommand.cs b/src/Stratis.VS.Solidity2/CustomCommand.cs deleted file mode 100644 index fdde0b9..0000000 --- a/src/Stratis.VS.Solidity2/CustomCommand.cs +++ /dev/null @@ -1,105 +0,0 @@ -using Microsoft.VisualStudio.Shell; -using Microsoft.VisualStudio.Shell.Interop; -using System; -using System.ComponentModel.Design; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Task = System.Threading.Tasks.Task; - -namespace Stratis.VS.Solidity2 -{ - /// - /// Command handler - /// - internal sealed class CustomCommand - { - /// - /// Command ID. - /// - public const int CommandId = 0x0100; - - /// - /// Command menu group (command set GUID). - /// - public static readonly Guid CommandSet = new Guid("7446631a-8d94-4937-b0db-6305e29d27c5"); - - /// - /// VS Package that provides this command, not null. - /// - private readonly AsyncPackage package; - - /// - /// Initializes a new instance of the class. - /// Adds our command handlers for menu (commands must exist in the command table file) - /// - /// Owner package, not null. - /// Command service to add command to, not null. - private CustomCommand(AsyncPackage package, OleMenuCommandService commandService) - { - this.package = package ?? throw new ArgumentNullException(nameof(package)); - commandService = commandService ?? throw new ArgumentNullException(nameof(commandService)); - - var menuCommandID = new CommandID(CommandSet, CommandId); - var menuItem = new MenuCommand(this.Execute, menuCommandID); - commandService.AddCommand(menuItem); - } - - /// - /// Gets the instance of the command. - /// - public static CustomCommand Instance - { - get; - private set; - } - - /// - /// Gets the service provider from the owner package. - /// - private Microsoft.VisualStudio.Shell.IAsyncServiceProvider ServiceProvider - { - get - { - return this.package; - } - } - - /// - /// Initializes the singleton instance of the command. - /// - /// Owner package, not null. - public static async Task InitializeAsync(AsyncPackage package) - { - // Switch to the main thread - the call to AddCommand in CustomCommand's constructor requires - // the UI thread. - await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(package.DisposalToken); - - OleMenuCommandService commandService = await package.GetServiceAsync(typeof(IMenuCommandService)) as OleMenuCommandService; - Instance = new CustomCommand(package, commandService); - } - - /// - /// This function is the callback used to execute the command when the menu item is clicked. - /// See the constructor to see how the menu item is associated with this function using - /// OleMenuCommandService service and MenuCommand class. - /// - /// Event sender. - /// Event args. - private void Execute(object sender, EventArgs e) - { - ThreadHelper.ThrowIfNotOnUIThread(); - string message = string.Format(CultureInfo.CurrentCulture, "Inside {0}.MenuItemCallback()", this.GetType().FullName); - string title = "CustomCommand"; - - // Show a message box to prove we were here - VsShellUtilities.ShowMessageBox( - this.package, - message, - title, - OLEMSGICON.OLEMSGICON_INFO, - OLEMSGBUTTON.OLEMSGBUTTON_OK, - OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST); - } - } -} diff --git a/src/Stratis.VS.Solidity2/CustomCommandPackage.cs b/src/Stratis.VS.Solidity2/CustomCommandPackage.cs deleted file mode 100644 index 1ce0460..0000000 --- a/src/Stratis.VS.Solidity2/CustomCommandPackage.cs +++ /dev/null @@ -1,76 +0,0 @@ -using Microsoft.VisualStudio; -using Microsoft.VisualStudio.OLE.Interop; -using Microsoft.VisualStudio.Shell; -using Microsoft.VisualStudio.Shell.Interop; -using Microsoft.Win32; -using System; -using System.ComponentModel.Design; -using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; -using System.Globalization; -using System.Runtime.InteropServices; -using System.Threading; -using System.Threading.Tasks; -using Task = System.Threading.Tasks.Task; - -namespace Stratis.VS.Solidity2 -{ - /// - /// This is the class that implements the package exposed by this assembly. - /// - /// - /// - /// The minimum requirement for a class to be considered a valid package for Visual Studio - /// is to implement the IVsPackage interface and register itself with the shell. - /// This package uses the helper classes defined inside the Managed Package Framework (MPF) - /// to do it: it derives from the Package class that provides the implementation of the - /// IVsPackage interface and uses the registration attributes defined in the framework to - /// register itself and its components with the shell. These attributes tell the pkgdef creation - /// utility what data to put into .pkgdef file. - /// - /// - /// To get loaded into VS, the package must be referred by <Asset Type="Microsoft.VisualStudio.VsPackage" ...> in .vsixmanifest file. - /// - /// - [PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)] - [ProvideMenuResource("Menus.ctmenu", 1)] - [Guid(CustomCommandPackage.PackageGuidString)] - [SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1650:ElementDocumentationMustBeSpelledCorrectly", Justification = "pkgdef, VS and vsixmanifest are valid VS terms")] - public sealed class CustomCommandPackage : AsyncPackage - { - /// - /// CustomCommandPackage GUID string. - /// - public const string PackageGuidString = "e0158e3d-7943-457e-a67d-c840b61533bd"; - - /// - /// Initializes a new instance of the class. - /// - public CustomCommandPackage() - { - // Inside this method you can place any initialization code that does not require - // any Visual Studio service because at this point the package object is created but - // not sited yet inside Visual Studio environment. The place to do all the other - // initialization is the Initialize method. - } - - #region Package Members - - /// - /// Initialization of the package; this method is called right after the package is sited, so this is the place - /// where you can put all the initialization code that rely on services provided by VisualStudio. - /// - /// A cancellation token to monitor for initialization cancellation, which can occur when VS is shutting down. - /// A provider for progress updates. - /// A task representing the async work of package initialization, or an already completed task if there is none. Do not return null from this method. - protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress progress) - { - // When initialized asynchronously, the current thread may be a background thread at this point. - // Do any initialization that requires the UI thread after switching to the UI thread. - await this.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); - await CustomCommand.InitializeAsync(this); - } - - #endregion - } -} diff --git a/src/Stratis.VS.Solidity2/CustomCommandPackage.vsct b/src/Stratis.VS.Solidity2/CustomCommandPackage.vsct deleted file mode 100644 index 9f862a0..0000000 --- a/src/Stratis.VS.Solidity2/CustomCommandPackage.vsct +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Stratis.VS.Solidity2/Grammars/Solidity.tmLanguage b/src/Stratis.VS.Solidity2/Grammars/Solidity.tmLanguage deleted file mode 100644 index 8015688..0000000 --- a/src/Stratis.VS.Solidity2/Grammars/Solidity.tmLanguage +++ /dev/null @@ -1,1531 +0,0 @@ - - - - - fileTypes - - sol - - firstLineMatch - ^#!/.*\b(pragma solidity \^[0..9]+\.[0..9]\.[0..9])$\n? - keyEquivalent - ^~S - name - Solidity - patterns - - - include - #core - - - repository - - brackets - - patterns - - - include - #round-brackets - - - include - #square-brackets - - - include - #curly-brackets - - - - comments - - patterns - - - include - #special-comments-conditional-compilation - - - begin - /\*\*(?!/) - captures - - 0 - - name - punctuation.definition.comment.sol - - - end - \*/ - name - comment.block.documentation.sol - - - begin - /\* - captures - - 0 - - name - punctuation.definition.comment.sol - - - end - \*/ - name - comment.block.sol - - - captures - - 1 - - name - punctuation.definition.comment.sol - - - match - (//).*$\n? - name - comment.line.double-slash.sol - - - - core - - patterns - - - include - #literal-function-labels - - - include - #literal-labels - - - include - #literal-keywords - - - include - #literal-for - - - include - #expression - - - include - #literal-punctuation - - - - curly-brackets - - patterns - - - begin - \{ - beginCaptures - - 0 - - name - meta.brace.curly.sol - - - end - \} - endCaptures - - 0 - - name - meta.brace.curly.sol - - - name - meta.group.braces.curly - patterns - - - include - $self - - - - - - expression - - patterns - - - include - #support - - - include - #literal-function - - - include - #literal-regexp - - - include - #literal-number - - - include - #literal-string - - - include - #literal-language-constant - - - include - #literal-language-variable - - - include - #literal-contract - - - include - #literal-library - - - include - #literal-function-call - - - include - #comments - - - include - #brackets - - - include - #literal-operators - - - include - #literal-variable - - - - function-declaration-parameters - - patterns - - - begin - \( - beginCaptures - - 0 - - name - punctuation.definition.parameters.begin.sol - - - end - \) - endCaptures - - 0 - - name - punctuation.definition.parameters.end.sol - - - patterns - - - match - [_$a-zA-Z][$\w]* - name - variable.parameter.function.sol - - - match - , - name - punctuation.separator.parameter.function.sol - - - include - #comments - - - - - - literal-contract - - patterns - - - begin - (?x) (?<!\.)\b(contract|interface) \s+((?!\b(is)\b)[A-Z][$\w]*)? - beginCaptures - - 1 - - name - storage.type.contract.sol - - 2 - - name - entity.name.contract.sol - - - end - } - endCaptures - - 0 - - name - meta.brace.curly.sol - - - - - - literal-library - - patterns - - - begin - (?x) (?<!\.)\b(library) \s+([A-Z][$\w]*)? - beginCaptures - - 1 - - name - storage.type.library.sol - - 2 - - name - entity.name.library.sol - - - end - } - endCaptures - - 0 - - name - meta.brace.curly.sol - - - - - - literal-for - - patterns - - - begin - (?<!\.)\b(for)\b - beginCaptures - - 1 - - name - keyword.control.loop.sol - - - end - \) - endCaptures - - 0 - - name - meta.brace.round.sol - - - name - meta.for.sol - patterns - - - begin - \( - beginCaptures - - 0 - - name - meta.brace.round.sol - - - end - (?=\)) - patterns - - - include - #literal-keyword-storage - - - include - #expression - - - include - #literal-punctuation - - - - - - - - literal-function - - patterns - - - begin - - (?x) \s*(function)(?:\s*(\*)|(?=\s|[(])) - \s*([_$a-zA-Z][$\w]*)?\s* - - beginCaptures - - 1 - - name - storage.type.sol - - 2 - - name - storage.type.function.sol - - 3 - - name - keyword.generator.asterisk.sol - - 4 - - name - entity.name.function.sol - - - end - (?<=\)) - name - meta.function.sol - patterns - - - include - #function-declaration-parameters - - - - - begin - - (?x) (\b[_$a-zA-Z][$\w]*) \s*= - \s*(function|event|modifier)(?:\s*(\*)|(?=\s|[(])) - \s*([_$a-zA-Z][$\w]*)?\s* - - beginCaptures - - 1 - - name - entity.name.function.sol - - 2 - - name - storage.type.sol - - 3 - - name - storage.type.function.sol - - 4 - - name - keyword.generator.asterisk.sol - - 5 - - name - entity.name.function.sol - - - end - (?<=\)) - name - meta.function.sol - patterns - - - include - #function-declaration-parameters - - - - - begin - - (?x) (\b_?[A-Z][$\w]*)? - (\.)([_$a-zA-Z][$\w]*) \s*= - \s*(function)(?:\s*(\*)|(?=\s|[(])) - \s*([_$a-zA-Z][$\w]*)?\s* - - beginCaptures - - 1 - - name - keyword.operator.accessor.sol - - 2 - - name - variable.language.prototype.sol - - 3 - - name - keyword.operator.accessor.sol - - 4 - - name - entity.name.function.sol - - 5 - - name - storage.type.sol - - 6 - - name - storage.type.function.sol - - 7 - - name - keyword.generator.asterisk.sol - - 8 - - name - entity.name.function.sol - - - end - (?<=\)) - name - meta.prototype.function.sol - patterns - - - include - #function-declaration-parameters - - - - - begin - - (?x) (\b_?[A-Z][$\w]*)? (\.)([_$a-zA-Z][$\w]*) \s*= - \s*(function|event|modifier)(?:\s*(\*)|(?=\s|[(])) - \s*([_$a-zA-Z][$\w]*)*\s* - - beginCaptures - - 1 - - name - keyword.operator.accessor.sol - - 2 - - name - entity.name.function.sol - - 3 - - name - storage.type.sol - - 4 - - name - storage.type.function.sol - - 5 - - name - keyword.generator.asterisk.sol - - 6 - - name - entity.name.function.sol - - - end - (?<=\)) - name - meta.function.static.sol - patterns - - - include - #function-declaration-parameters - - - - - - literal-function-call - - patterns - - - captures - - 1 - - name - entity.name.function.sol - - 2 - - name - meta.group.braces.round.function.arguments.sol - - - match - (?x) ([_$a-zA-Z][$\w]*)\s* (\(\s*\)) - name - meta.function-call.without-arguments.sol - - - captures - - 1 - - name - entity.name.function.sol - - - match - (?x) ([_$a-zA-Z][$\w]*)\s* (?=\() - name - meta.function-call.with-arguments.sol - - - - literal-function-labels - - patterns - - - begin - - (?x) \b([_$a-zA-Z][$\w]*) \s*(:) - \s*(function|event|modifier)(?:\s*(\*)|(?=\s|[(])) - \s*([_$a-zA-Z][$\w]*)*\s* - - beginCaptures - - 1 - - name - entity.name.function.sol - - 2 - - name - punctuation.separator.key-value.sol - - 3 - - name - storage.type.sol - - 4 - - name - storage.type.function.sol - - 5 - - name - keyword.generator.asterisk.sol - - 6 - - name - entity.name.function.sol - - - end - (?<=\)) - patterns - - - include - #function-declaration-parameters - - - - - begin - - (?x) (?: - ((')((?:[^']|\\')*)('))| - ((")((?:[^"]|\\")*)(")) ) \s*(:) - \s*(function|event|modifier)(?:\s*(\*)|(?=\s|[(])) - \s*([_$a-zA-Z][$\w]*)*\s* - - beginCaptures - - 1 - - name - string.quoted.single.sol - - 10 - - name - storage.type.sol - - 11 - - name - storage.type.function.sol - - 12 - - name - keyword.generator.asterisk.sol - - 13 - - name - entity.name.function.sol - - 2 - - name - punctuation.definition.string.begin.sol - - 3 - - name - entity.name.function.sol - - 4 - - name - punctuation.definition.string.end.sol - - 5 - - name - string.quoted.double.sol - - 6 - - name - punctuation.definition.string.begin.sol - - 7 - - name - entity.name.function.sol - - 8 - - name - punctuation.definition.string.end.sol - - 9 - - name - punctuation.separator.key-value.sol - - - end - (?<=\)) - patterns - - - include - #function-declaration-parameters - - - - - - literal-keyword-storage - - patterns - - - match - (?<!\.)\b(constant)\b - name - storage.type.sol - - - - literal-keywords - - patterns - - - include - #literal-keyword-storage - - - match - (?<!\.)\b(return)\b - name - keyword.control.flow.sol - - - match - (?<!\.)\b(if|else)\b - name - keyword.control.conditional.sol - - - match - (?<!\.)\b(require|assert)\b - name - keyword.require-assert.sol - - - - literal-labels - - patterns - - - begin - - (?x) (?<!\?)(?<!\?\s)(?=( - ((')((?:[^']|\\')*)('))| - ((")((?:[^"]|\\")*)(")) )\s*:) - - end - : - endCaptures - - 0 - - name - punctuation.separator.key-value.sol - - - patterns - - - include - #literal-string - - - - - captures - - 1 - - name - string.unquoted.label.sol - - 2 - - name - punctuation.separator.key-value.sol - - - match - (?<!\.|\?|\?\s)([_$a-zA-Z][$\w]*)\s*(:) - name - constant.other.object.key.sol - - - - literal-language-constant - - patterns - - - match - (?<!\.)\btrue\b - name - constant.language.boolean.true.sol - - - match - (?<!\.)\bfalse\b - name - constant.language.boolean.false.sol - - - - literal-language-variable - - patterns - - - match - (?<!(?<!\.\.)\.)\b(arguments)\b - name - variable.language.arguments.sol - - - match - (?<!(?<!\.\.)\.)\b(super)\b - name - variable.language.super.sol - - - match - (?<!(?<!\.\.)\.)\b(this)\b - name - variable.language.this.sol - - - - literal-number - - patterns - - - match - (?i)(?:\B[-+]|\b)0x[0-9a-f]*\.(\B|\b[0-9]+) - name - invalid.illegal.numeric.hex.sol - - - match - (?:\B[-+]|\b)0[0-9]+\.(\B|\b[0-9]+) - name - invalid.illegal.numeric.octal.sol - - - match - - (?xi) (?:\B[-+])? (?: \b0b[0-1]*| # binary - \b0o[0-7]*| # octal \b0x[0-9a-f]*| # hex ( - \B\.[0-9]+| # e.g. .999 \b[0-9]+(\.[0-9]*)? # e.g. - 999.999, 999. or 999 )(e[-+]?[0-9]+)? # e.g. e+123, - E-123 ) - - name - constant.numeric.sol - - - - literal-operators - - patterns - - - match - (?<!\.)\b(delete|new)\b - name - keyword.operator.sol - - - match - - (?x) !(?!=)| # logical-not right-to-left right - && | # logical-and left-to-right both \|\| | - # logical-or left-to-right both - - name - keyword.operator.logical.sol - - - match - (?x) =(?!=)| # assignment right-to-left both - name - keyword.operator.assignment.sol - - - match - - (?x) %= | # assignment right-to-left both &= | # - assignment right-to-left both \*= | # assignment - right-to-left both \+= | # assignment right-to-left - both -= | # assignment right-to-left both /= | # - assignment right-to-left both \^= | # assignment - right-to-left both \|= | # assignment right-to-left - both <<= | # assignment right-to-left both - >>= | # assignment right-to-left both - >>>= | # assignment right-to-left both - - name - keyword.operator.assignment.augmented.sol - - - match - - (?x) ~ | # bitwise-not right-to-left right << - | # bitwise-shift left-to-right both >>> | - # bitwise-shift left-to-right both >> | # - bitwise-shift left-to-right both & | # - bitwise-and left-to-right both \^ | # bitwise-xor - left-to-right both \| # bitwise-or left-to-right - both - - name - keyword.operator.bitwise.sol - - - match - - (?x) <= | # relational left-to-right both >= | - # relational left-to-right both < | # relational - left-to-right both > # relational left-to-right - both - - name - keyword.operator.relational.sol - - - match - - (?x) == | # equality left-to-right both != # equality left-to-right both - - name - keyword.operator.comparison.sol - - - match - - (?x) / | # division left-to-right both - % | # modulus left-to-right both - \* | # multiplication left-to-right both - \+ | # addition left-to-right both - - # subtraction left-to-right both - - name - keyword.operator.arithmetic.sol - - - match - \?|: - name - keyword.operator.ternary.sol - - - match - (?<!\.)\.\.\. - name - keyword.operator.spread.sol - - - match - \. - name - keyword.operator.accessor.sol - - - - literal-prototype - - patterns - - - captures - - 1 - - name - entity.name.class.sol - - 2 - - name - keyword.operator.accessor.sol - - 3 - - name - variable.language.prototype.sol - - - match - ([_$a-zA-Z][$\w]*)(\.)(prototype)\b - name - meta.prototype.access.sol - - - captures - - 1 - - name - entity.name.class.sol - - 2 - - name - keyword.operator.accessor.sol - - 3 - - name - variable.language.prototype.sol - - - match - ([_$a-zA-Z][$\w]*)(\.)(prototype)\s*=\s* - name - meta.prototype.declaration.sol - - - - literal-punctuation - - patterns - - - match - \; - name - punctuation.terminator.statement.sol - - - match - , - name - meta.delimiter.comma.sol - - - - literal-regexp - - patterns - - - begin - - (?x) (?<= - \.|\(|,|{|}|\[|;|,|<|>|<=|>=|==|!=|\+|-|\*|%|\+\+|--|<<|>>|>>>|&|\||\^|!|~|&&|\|\||\?|:|=|\+=|-=|\*=|%=|<<=|>>=|>>>=|&=|\|=|\^=|/|/=| \Wnew|\Wdelete|\Wvoid|\Wreturn| ^new|^delete|^void|^return|^ )\s* (/) (?!/|\*|$) - - beginCaptures - - 1 - - name - punctuation.definition.string.begin.sol - - - end - (/)([gimy]*) - endCaptures - - 1 - - name - punctuation.definition.string.end.sol - - 2 - - name - keyword.other.sol - - - name - string.regexp.sol - patterns - - - include - source.regexp.sol - - - - - - literal-string - - patterns - - - begin - ' - beginCaptures - - 0 - - name - punctuation.definition.string.begin.sol - - - end - (')|(\n) - endCaptures - - 1 - - name - punctuation.definition.string.end.sol - - 2 - - name - invalid.illegal.newline.sol - - - name - string.quoted.single.sol - patterns - - - include - #string-content - - - - - begin - " - beginCaptures - - 0 - - name - punctuation.definition.string.begin.sol - - - end - (")|(\n) - endCaptures - - 1 - - name - punctuation.definition.string.end.sol - - 2 - - name - invalid.illegal.newline.sol - - - name - string.quoted.double.sol - patterns - - - include - #string-content - - - - - - literal-variable - - patterns - - - match - [A-Z][_$\dA-Z]*\b - name - variable.other.constant.sol - - - captures - - 1 - - name - punctuation.dollar.sol - - - match - (\$)[$\w]+ - name - variable.other.dollar.sol - - - captures - - 1 - - name - variable.other.class.sol - - 2 - - name - keyword.operator.accessor.sol - - 3 - - name - variable.other.property.static.sol - - - match - (?x) \b([A-Z][$\w]*)\s*(\.) ([_$a-zA-Z][$\w]*) - name - meta.property.class.sol - - - captures - - 1 - - name - variable.other.object.sol - - - match - (?<!\.)[_$a-zA-Z][$\w]*\s*(?=[\[\.]) - name - variable.other.object.sol - - - captures - - 2 - - name - variable.other.property.sol - - - match - (?<=\.)\s*[_$a-zA-Z][$\w]* - name - meta.property.object.sol - - - match - [_$a-zA-Z][$\w]* - name - variable.other.readwrite.sol - - - - round-brackets - - patterns - - - begin - \( - beginCaptures - - 0 - - name - meta.brace.round.sol - - - end - \) - endCaptures - - 0 - - name - meta.brace.round.sol - - - name - meta.group.braces.round - patterns - - - include - #expression - - - - - - special-comments-conditional-compilation - - patterns - - - begin - /\*(?=@) - captures - - 0 - - name - punctuation.definition.comment.sol - - - end - \*/ - endCaptures - - 1 - - name - keyword.control.conditional.sol - - 2 - - name - punctuation.definition.keyword.sol - - - name - comment.block.conditional.sol - patterns - - - match - /\* - name - punctuation.definition.comment.sol - - - include - $self - - - - - captures - - 1 - - name - punctuation.definition.keyword.sol - - - match - (@)(if|elif|else|end|ifdef|endif|cc_on|set)\b - name - keyword.control.conditional.sol - - - captures - - 1 - - name - punctuation.definition.variable.sol - - - - - - square-brackets - - patterns - - - begin - \[ - beginCaptures - - 0 - - name - meta.brace.square.sol - - - end - \] - endCaptures - - 0 - - name - meta.brace.square.sol - - - name - meta.group.braces.square - patterns - - - include - #expression - - - - - - string-content - - patterns - - - match - \\\s*\n - name - constant.character.escape.newline.sol - - - match - \\(x[\da-fA-F]{2}|u[\da-fA-F]{4}|.) - name - constant.character.escape.sol - - - - support - - patterns - - - match - \.(pop|push)\b - name - support.function.mutator.sol - - - begin - {{ - end - }} - name - meta.tag.mustache.sol - - - - - scopeName - source.sol - uuid - 3F50A19F-DEE2-4C44-8F60-C01CEE8CEA68 - - diff --git a/src/Stratis.VS.Solidity2/Key.snk b/src/Stratis.VS.Solidity2/Key.snk deleted file mode 100644 index e722fd4..0000000 Binary files a/src/Stratis.VS.Solidity2/Key.snk and /dev/null differ diff --git a/src/Stratis.VS.Solidity2/Properties/AssemblyInfo.cs b/src/Stratis.VS.Solidity2/Properties/AssemblyInfo.cs deleted file mode 100644 index 3fec39e..0000000 --- a/src/Stratis.VS.Solidity2/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Stratis.VS.Solidity2")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Stratis.VS.Solidity2")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/Stratis.VS.Solidity2/Resources/CustomCommand.png b/src/Stratis.VS.Solidity2/Resources/CustomCommand.png deleted file mode 100644 index b22d975..0000000 Binary files a/src/Stratis.VS.Solidity2/Resources/CustomCommand.png and /dev/null differ diff --git a/src/Stratis.VS.Solidity2/Resources/CustomCommandPackage.ico b/src/Stratis.VS.Solidity2/Resources/CustomCommandPackage.ico deleted file mode 100644 index d323b07..0000000 Binary files a/src/Stratis.VS.Solidity2/Resources/CustomCommandPackage.ico and /dev/null differ diff --git a/src/Stratis.VS.Solidity2/Resources/StratisLogo200x200.png b/src/Stratis.VS.Solidity2/Resources/StratisLogo200x200.png deleted file mode 100644 index 5634633..0000000 Binary files a/src/Stratis.VS.Solidity2/Resources/StratisLogo200x200.png and /dev/null differ diff --git a/src/Stratis.VS.Solidity2/Resources/StratisLogo64x64.png b/src/Stratis.VS.Solidity2/Resources/StratisLogo64x64.png deleted file mode 100644 index 38e3f87..0000000 Binary files a/src/Stratis.VS.Solidity2/Resources/StratisLogo64x64.png and /dev/null differ diff --git a/src/Stratis.VS.Solidity2/SolidityContentTypeDefinition.cs b/src/Stratis.VS.Solidity2/SolidityContentTypeDefinition.cs deleted file mode 100644 index 27df3ce..0000000 --- a/src/Stratis.VS.Solidity2/SolidityContentTypeDefinition.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.VisualStudio.LanguageServer.Client; -using Microsoft.VisualStudio.Utilities; -using System.ComponentModel.Composition; - -namespace Stratis.VS -{ -#pragma warning disable 649 - public class SolidityContentDefinition - { - [Export] - [Name("solidity")] - [BaseDefinition(CodeRemoteContentDefinition.CodeRemoteContentTypeName)] - internal static ContentTypeDefinition SolidityContentTypeDefinition; - - - [Export] - [FileExtension(".sol")] - [ContentType("solidity")] - internal static FileExtensionToContentTypeDefinition SolidityFileExtensionDefinition; - } -#pragma warning restore 649 -} diff --git a/src/Stratis.VS.Solidity2/SolidityLanguageClient.cs b/src/Stratis.VS.Solidity2/SolidityLanguageClient.cs deleted file mode 100644 index ff155a6..0000000 --- a/src/Stratis.VS.Solidity2/SolidityLanguageClient.cs +++ /dev/null @@ -1,196 +0,0 @@ -using Microsoft.VisualStudio.LanguageServer.Client; -using Microsoft.VisualStudio.Shell; -using Microsoft.VisualStudio.Utilities; -using StreamJsonRpc; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.IO.Pipes; -using System.Reflection; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.VisualStudio.Threading; -using Newtonsoft.Json.Linq; -using Task = System.Threading.Tasks.Task; -using Microsoft.VisualStudio.LanguageServer.Protocol; -using System.ComponentModel.Composition; - - -using Stratis.DevEx; -using EnvDTE; -using System.Configuration; -using System.IO.Pipelines; - -namespace Stratis.VS -{ - [ContentType("solidity")] - [Export(typeof(ILanguageClient))] - [RunOnContext(RunningContext.RunOnHost)] - public class SolidityLanguageClient : Runtime, ILanguageClient, ILanguageClientCustomMessage2 - { - - static SolidityLanguageClient() - { - Initialize("Stratis.VS.Solidity", "LanguageClient"); - } - public SolidityLanguageClient() - { - Instance = this; - this.MiddleLayer = null;// new SolidityLanguageClientMiddleLayer(); - } - - internal static SolidityLanguageClient Instance - { - get; - set; - } - - internal System.Diagnostics.Process ServerProcess { get; set; } - - internal JsonRpc Rpc - { - get; - set; - } - - public event AsyncEventHandler StartAsync; - public event AsyncEventHandler StopAsync; - - public string Name => "Solidity Language Extension"; - - public IEnumerable ConfigurationSections - { - get - { - yield return "solidity"; - } - } - - public object InitializationOptions => null; - - public IEnumerable FilesToWatch => null; - - public object MiddleLayer - { - get; - set; - } - - public object CustomMessageTarget => null; - - public bool ShowNotificationOnInitializeFailed => true; - - protected bool StartLanguageServerProcess() - { - ProcessStartInfo info = new ProcessStartInfo(); - //var programPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Server", @"LanguageServerWithUI.exe"); - //var programPath = "nomicfoundation-solidity-language-server"; - var programPath = "cmd.exe"; - info.FileName = programPath; - //info.WorkingDirectory = Path.GetDirectoryName(programPath); - info.Arguments = "/c C:\\Users\\Allister\\AppData\\Roaming\\npm\\nomicfoundation-solidity-language-server.cmd --stdio"; - info.RedirectStandardInput = true; - info.RedirectStandardOutput = true; - info.UseShellExecute = false; - info.CreateNoWindow = false; - - var process = new System.Diagnostics.Process(); - process.StartInfo = info; - process.EnableRaisingEvents = true; - process.Exited += (e, args) => - { - Info("Language server proceess exited. Restarting."); - process.Start(); - }; - ServerProcess = process; - return process.Start(); - } - public async Task ActivateAsync(CancellationToken token) - { - await Task.Yield(); - throw new Exception(); - - //Debugger.Launch(); - - if (StartLanguageServerProcess()) - { - Info("Started language server process {proc} {p}.", ServerProcess.StartInfo.FileName, ServerProcess.StartInfo.Arguments); - return new Connection(ServerProcess.StandardOutput.BaseStream, ServerProcess.StandardInput.BaseStream); - } - else - { - Info("Could not start language server process {proc}", ServerProcess.StartInfo.FileName); - return null; - } - } - - public async Task OnLoadedAsync() - { - if (StartAsync != null) - { - await StartAsync.InvokeAsync(this, EventArgs.Empty); - } - } - - public async Task StopServerAsync() - { - if (StopAsync != null) - { - await StopAsync.InvokeAsync(this, EventArgs.Empty); - } - } - - public Task OnServerInitializedAsync() - { - return Task.CompletedTask; - } - - public Task AttachForCustomMessageAsync(JsonRpc rpc) - { - this.Rpc = rpc; - - return Task.CompletedTask; - } - - public Task OnServerInitializeFailedAsync(ILanguageClientInitializationInfo initializationState) - { - string message = "Solidity language server failed to initialize."; - Error(message); - string exception = initializationState.InitializationException?.ToString() ?? string.Empty; - message = $"{message}\n {exception}"; - - var failureContext = new InitializationFailureContext() - { - FailureMessage = message, - }; - - return Task.FromResult(failureContext); - } - - internal class SolidityLanguageClientMiddleLayer : ILanguageClientMiddleLayer - { - public bool CanHandle(string methodName) - { - //Info("Calling method {m}", methodName); - //return methodName == Methods.TextDocumentCompletionName; - return true; - } - - public Task HandleNotificationAsync(string methodName, JToken methodParam, Func sendNotification) - { - Info("Notification {req} {param}.", methodName, methodParam.ToString()); - //await sendNotification(methodParam); - return Task.CompletedTask; - //throw new NotImplementedException(); - } - - public async Task HandleRequestAsync(string methodName, JToken methodParam, Func> sendRequest) - { - Info("Request {req} {param}.", methodName, methodParam.ToString()); - var result = await sendRequest(methodParam); - return result; - } - } - } -} diff --git a/src/Stratis.VS.Solidity2/SolidityLanguageSettings.json b/src/Stratis.VS.Solidity2/SolidityLanguageSettings.json deleted file mode 100644 index 5e04166..0000000 --- a/src/Stratis.VS.Solidity2/SolidityLanguageSettings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "foo.maxNumberOfProblems": -1 -} diff --git a/src/Stratis.VS.Solidity2/SolidityLanguageSettings.pkgdef b/src/Stratis.VS.Solidity2/SolidityLanguageSettings.pkgdef deleted file mode 100644 index 629addd..0000000 --- a/src/Stratis.VS.Solidity2/SolidityLanguageSettings.pkgdef +++ /dev/null @@ -1,5 +0,0 @@ -[$RootKey$\OpenFolder\Settings\VSWorkspaceSettings\SolidityLanguageExtension] -@="$PackageFolder$\SolidityLanguageSettings.json" - -[$RootKey$\TextMate\Repositories] -"Solidity"="$PackageFolder$\Grammars" \ No newline at end of file diff --git a/src/Stratis.VS.Solidity2/Stratis.VS.Solidity2.csproj b/src/Stratis.VS.Solidity2/Stratis.VS.Solidity2.csproj deleted file mode 100644 index 431d46e..0000000 --- a/src/Stratis.VS.Solidity2/Stratis.VS.Solidity2.csproj +++ /dev/null @@ -1,137 +0,0 @@ - - - - 17.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - false - - - Key.snk - - - - Debug - AnyCPU - 2.0 - {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - {6546214D-9FE1-4244-BC3E-2D7CA5A65194} - Library - Properties - Stratis.VS.Solidity2 - Stratis.VS.Solidity2 - v4.7.2 - true - true - true - false - false - true - true - Program - $(DevEnvDir)devenv.exe - /rootsuffix Exp - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - true - - - - - Designer - - - - - - - - - - - - - - 17.8.36 - - - 17.2.8 - - - - - - - Menus.ctmenu - - - - - true - VSPackage - - - - - true - Always - - - - - Always - true - - - Always - true - - - - - {a0bff0db-ed9a-4639-ae86-8e709a1efc66} - NLog - - - {f54aa3e2-f4bf-4c94-8ac9-a476265a70bf} - Stratis.DevEx.Base - - - - - - - \ No newline at end of file diff --git a/src/Stratis.VS.Solidity2/Stratis.VS.Solidity2Package.cs b/src/Stratis.VS.Solidity2/Stratis.VS.Solidity2Package.cs deleted file mode 100644 index b09e595..0000000 --- a/src/Stratis.VS.Solidity2/Stratis.VS.Solidity2Package.cs +++ /dev/null @@ -1,53 +0,0 @@ -using Microsoft.VisualStudio.Shell; -using System; -using System.Runtime.InteropServices; -using System.Threading; -using Task = System.Threading.Tasks.Task; - -namespace Stratis.VS -{ - /// - /// This is the class that implements the package exposed by this assembly. - /// - /// - /// - /// The minimum requirement for a class to be considered a valid package for Visual Studio - /// is to implement the IVsPackage interface and register itself with the shell. - /// This package uses the helper classes defined inside the Managed Package Framework (MPF) - /// to do it: it derives from the Package class that provides the implementation of the - /// IVsPackage interface and uses the registration attributes defined in the framework to - /// register itself and its components with the shell. These attributes tell the pkgdef creation - /// utility what data to put into .pkgdef file. - /// - /// - /// To get loaded into VS, the package must be referred by <Asset Type="Microsoft.VisualStudio.VsPackage" ...> in .vsixmanifest file. - /// - /// - [PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)] - [Guid(SolidityPackage.PackageGuidString)] - public sealed class SolidityPackage : AsyncPackage - { - /// - /// Stratis.VS.Solidity2Package GUID string. - /// - public const string PackageGuidString = "6aaa9d2d-e18e-4b7c-9cca-2d1dbb0b024d"; - - #region Package Members - - /// - /// Initialization of the package; this method is called right after the package is sited, so this is the place - /// where you can put all the initialization code that rely on services provided by VisualStudio. - /// - /// A cancellation token to monitor for initialization cancellation, which can occur when VS is shutting down. - /// A provider for progress updates. - /// A task representing the async work of package initialization, or an already completed task if there is none. Do not return null from this method. - protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress progress) - { - // When initialized asynchronously, the current thread may be a background thread at this point. - // Do any initialization that requires the UI thread after switching to the UI thread. - await this.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); - } - - #endregion -} -} diff --git a/src/Stratis.VS.Solidity2/StratisLogo200x200.png b/src/Stratis.VS.Solidity2/StratisLogo200x200.png deleted file mode 100644 index 5634633..0000000 Binary files a/src/Stratis.VS.Solidity2/StratisLogo200x200.png and /dev/null differ diff --git a/src/Stratis.VS.Solidity2/StratisLogo64x64.png b/src/Stratis.VS.Solidity2/StratisLogo64x64.png deleted file mode 100644 index 38e3f87..0000000 Binary files a/src/Stratis.VS.Solidity2/StratisLogo64x64.png and /dev/null differ diff --git a/src/Stratis.VS.Solidity2/VSPackage.resx b/src/Stratis.VS.Solidity2/VSPackage.resx deleted file mode 100644 index 8c04aa7..0000000 --- a/src/Stratis.VS.Solidity2/VSPackage.resx +++ /dev/null @@ -1,140 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - CustomCommand Extension - - - CustomCommand Visual Studio Extension Detailed Info - - - Resources\CustomCommandPackage.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - \ No newline at end of file diff --git a/src/Stratis.VS.Solidity2/source.extension.vsixmanifest b/src/Stratis.VS.Solidity2/source.extension.vsixmanifest deleted file mode 100644 index 3557df7..0000000 --- a/src/Stratis.VS.Solidity2/source.extension.vsixmanifest +++ /dev/null @@ -1,27 +0,0 @@ - - - - - Stratis.VS.Solidity4 - Stratis smart contract extension - StratisLogo64x64.png - StratisLogo200x200.png - - - - amd64 - - - - - - - - - - - - - - - diff --git a/src/Stratis.VS.StratisEVM/SolidityLanguageClient.cs b/src/Stratis.VS.StratisEVM/SolidityLanguageClient.cs index a13bbfe..f800553 100644 --- a/src/Stratis.VS.StratisEVM/SolidityLanguageClient.cs +++ b/src/Stratis.VS.StratisEVM/SolidityLanguageClient.cs @@ -172,22 +172,19 @@ public bool CanHandle(string methodName) { //Info("Calling method {m}", methodName); //return methodName == Methods.TextDocumentCompletionName; - return false; + return true; } public async Task HandleNotificationAsync(string methodName, JToken methodParam, Func sendNotification) { Info("Notification {req} {param}.", methodName, methodParam.ToString()); await sendNotification(methodParam); - //return Task.CompletedTask; - //throw new NotImplementedException(); } public async Task HandleRequestAsync(string methodName, JToken methodParam, Func> sendRequest) { Info("Request {req} {param}.", methodName, methodParam.ToString()); - var result = await sendRequest(methodParam); - return result; + return await sendRequest(methodParam); } } } diff --git a/src/Stratis.VS.StratisEVM/SolidityLanguageSettings.json b/src/Stratis.VS.StratisEVM/SolidityLanguageSettings.json index 80b61bd..efe72d5 100644 --- a/src/Stratis.VS.StratisEVM/SolidityLanguageSettings.json +++ b/src/Stratis.VS.StratisEVM/SolidityLanguageSettings.json @@ -1,4 +1,3 @@ { - "solidity.maxNumberOfProblems": -1, - "solidity.trace.server": "Messages" -} + "solidity.trace.server": "Verbose" +} \ No newline at end of file diff --git a/src/Stratis.VS.StratisEVM/source.extension.vsixmanifest b/src/Stratis.VS.StratisEVM/source.extension.vsixmanifest index ddc4653..e44c499 100644 --- a/src/Stratis.VS.StratisEVM/source.extension.vsixmanifest +++ b/src/Stratis.VS.StratisEVM/source.extension.vsixmanifest @@ -3,7 +3,7 @@ Stratis.VS.StratisEVM - StratisEVM smart contracts extension. + StratisEVM smart contracts extension StratisLogo64x64.png StratisLogo200x200.png