forked from actions/runner
-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
azp: vscode extension completions (#403)
* semantic highlighting * fix schema of task step to include target
- Loading branch information
1 parent
16d82ce
commit 2915ead
Showing
28 changed files
with
3,717 additions
and
695 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Reflection; | ||
|
||
using Newtonsoft.Json; | ||
|
||
namespace Sdk.Actions { | ||
|
||
public class ActionsDescriptions | ||
{ | ||
|
||
public static Dictionary<string, TSource> ToOrdinalIgnoreCaseDictionary<TSource>(IEnumerable<KeyValuePair<string, TSource>> source) { | ||
var ret = new Dictionary<string, TSource>(StringComparer.OrdinalIgnoreCase); | ||
foreach(var kv in source) { | ||
ret[kv.Key] = kv.Value; | ||
} | ||
return ret; | ||
} | ||
|
||
public string Description { get; set; } | ||
|
||
public Dictionary<string, string> Versions { get; set; } | ||
public static Dictionary<string, Dictionary<string, ActionsDescriptions>> LoadDescriptions() { | ||
var assembly = Assembly.GetExecutingAssembly(); | ||
var json = default(String); | ||
using (var stream = assembly.GetManifestResourceStream("descriptions.json")) | ||
using (var streamReader = new StreamReader(stream)) | ||
{ | ||
json = streamReader.ReadToEnd(); | ||
} | ||
|
||
return ToOrdinalIgnoreCaseDictionary(JsonConvert.DeserializeObject<Dictionary<string, Dictionary<string, ActionsDescriptions>>>(json).Select(kv => new KeyValuePair<string, Dictionary<string, ActionsDescriptions>>(kv.Key, ToOrdinalIgnoreCaseDictionary(kv.Value)))); | ||
} | ||
} | ||
|
||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
using System.Reflection.Emit; | ||
|
||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Serialization; | ||
|
||
namespace Runner.Server.Azure.Devops { | ||
|
||
[JsonObject("", NamingStrategyType = typeof(CamelCaseNamingStrategy), ItemNullValueHandling = NullValueHandling.Ignore)] | ||
public class CompletionItemLabel { | ||
public string Label { get; set; } | ||
public string Description { get; set; } | ||
public string Detail { get; set; } | ||
} | ||
[JsonObject("", NamingStrategyType = typeof(CamelCaseNamingStrategy), ItemNullValueHandling = NullValueHandling.Ignore)] | ||
public class MarkdownString { | ||
public string Value { get; set; } | ||
public bool? SupportThemeIcons { get; set; } | ||
public bool? SupportHtml { get; set; } | ||
} | ||
|
||
[JsonObject("", NamingStrategyType = typeof(CamelCaseNamingStrategy), ItemNullValueHandling = NullValueHandling.Ignore)] | ||
public class SnippedString { | ||
public string Value { get; set; } | ||
} | ||
|
||
[JsonObject("", NamingStrategyType = typeof(CamelCaseNamingStrategy), ItemNullValueHandling = NullValueHandling.Ignore)] | ||
public class Position { | ||
public long Character { get; set; } | ||
public long Line { get; set; } | ||
} | ||
|
||
[JsonObject("", NamingStrategyType = typeof(CamelCaseNamingStrategy), ItemNullValueHandling = NullValueHandling.Ignore)] | ||
public class Range { | ||
public Position Start { get; set; } | ||
public Position End { get; set; } | ||
public bool? IsEmpty { get; set; } | ||
public bool? IsSingleLine { get; set; } | ||
} | ||
[JsonObject("", NamingStrategyType = typeof(CamelCaseNamingStrategy), ItemNullValueHandling = NullValueHandling.Ignore)] | ||
public class InsertReplaceRange { | ||
public Range Inserting { get; set; } | ||
public Range Replacing { get; set; } | ||
} | ||
|
||
[JsonObject("", NamingStrategyType = typeof(CamelCaseNamingStrategy), ItemNullValueHandling = NullValueHandling.Ignore)] | ||
public class CompletionItem { | ||
public CompletionItemLabel Label { get; set; } | ||
public string FilterText { get; set; } | ||
public SnippedString InsertText { get; set; } | ||
public string SortText { get; set; } | ||
public bool? Preselect { get; set; } | ||
public string Detail { get; set; } | ||
public string[] CommitCharacters { get; set; } | ||
public bool? KeepWhitespace { get; set; } | ||
public int? Kind { get; set; } | ||
public InsertReplaceRange Range { get; set; } | ||
public MarkdownString Documentation { get; set; } | ||
|
||
[JsonIgnore] | ||
public int Priority { get; set; } = 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.