Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

restore performance of vscode extension #436

Merged
merged 1 commit into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/Runner.Language.Server/AutoCompleter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ public async Task<CompletionList> Handle(CompletionParams request, CancellationT
TraceWriter = new GitHub.DistributedTask.ObjectTemplating.EmptyTraceWriter(),
Flags = GitHub.DistributedTask.Expressions2.ExpressionFlags.DTExpressionsV1 | GitHub.DistributedTask.Expressions2.ExpressionFlags.ExtendedDirectives | GitHub.DistributedTask.Expressions2.ExpressionFlags.AllowAnyForInsert,
Column = column,
Row = row
Row = row,
RawMapping = true
};
GitHub.DistributedTask.ObjectTemplating.Schema.TemplateSchema? schema = null;
try {
Expand Down
3 changes: 2 additions & 1 deletion src/Runner.Language.Server/HoverProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ private static TemplateContext CreateTemplateContext(GitHub.DistributedTask.Obje
TraceWriter = new GitHub.DistributedTask.ObjectTemplating.EmptyTraceWriter(),
Flags = GitHub.DistributedTask.Expressions2.ExpressionFlags.DTExpressionsV1 | GitHub.DistributedTask.Expressions2.ExpressionFlags.ExtendedDirectives | GitHub.DistributedTask.Expressions2.ExpressionFlags.AllowAnyForInsert,
Column = column,
Row = row
Row = row,
RawMapping = true
};
try {
var isWorkflow = request.TextDocument.Uri.Path.Contains("/.github/workflows/");
Expand Down
1 change: 1 addition & 0 deletions src/Runner.Language.Server/SemanticTokenHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ private static TemplateContext CreateTemplateContext(GitHub.DistributedTask.Obj
FileProvider = new DefaultInMemoryFileProviderFileProvider(files.ToArray()),
TraceWriter = new GitHub.DistributedTask.ObjectTemplating.EmptyTraceWriter(),
Flags = GitHub.DistributedTask.Expressions2.ExpressionFlags.DTExpressionsV1 | GitHub.DistributedTask.Expressions2.ExpressionFlags.ExtendedDirectives | GitHub.DistributedTask.Expressions2.ExpressionFlags.AllowAnyForInsert,
RawMapping = true
};
TemplateToken? token = null;
List<int>? semTokens = null;
Expand Down
6 changes: 3 additions & 3 deletions src/Sdk/AzurePipelines/AzureDevops.cs
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ private static ((int, int)[], Dictionary<(int, int), int>) CreateIdxMapping(Temp

var scanner = new YamlDotNet.Core.Scanner(new StringReader(xraw), true);
try {
while(scanner.MoveNext()) {
while(scanner.MoveNext() && !(scanner.Current is YamlDotNet.Core.Tokens.Error)) {
if(scanner.Current is YamlDotNet.Core.Tokens.Scalar s) {
var x = s.Value;
var m = x.IndexOf(C);
Expand Down Expand Up @@ -765,7 +765,7 @@ private static int GetIdxOfExpression(LiteralToken lit, int row, int column)

var scanner = new YamlDotNet.Core.Scanner(new StringReader(xraw), true);
try {
while(scanner.MoveNext()) {
while(scanner.MoveNext() && !(scanner.Current is YamlDotNet.Core.Tokens.Error)) {
if(scanner.Current is YamlDotNet.Core.Tokens.Scalar s) {
var x = s.Value;
return x.IndexOf(C);
Expand Down Expand Up @@ -810,7 +810,7 @@ private static int GetIdxOfExpression(LiteralToken lit, int row, int column)
var fileId = templateContext.GetFileId(errorTemplateFileName);

// preserveString is needed for azure pipelines compatibility of the templateContext property all boolean and number token are casted to string without loosing it's exact string value
var yamlObjectReader = new YamlObjectReader(fileId, fileContent, preserveString: true, forceAzurePipelines: true);
var yamlObjectReader = new YamlObjectReader(fileId, fileContent, preserveString: true, forceAzurePipelines: true, rawMapping: context.RawMapping);
TemplateToken token = TemplateReader.Read(templateContext, schemaName ?? "pipeline-root", yamlObjectReader, fileId, out _);

context.SemTokens = templateContext.SemTokens;
Expand Down
2 changes: 2 additions & 0 deletions src/Sdk/AzurePipelines/Context.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ public class Context {
internal List<AutoCompleteEntry> AutoCompleteMatches { get; set; }
public List<int> SemTokens { get; internal set; }

public bool RawMapping { get; set; }

public Context Clone() {
return MemberwiseClone() as Context;
}
Expand Down
68 changes: 15 additions & 53 deletions src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -594,20 +594,20 @@
LiteralToken token,
DefinitionInfo definitionInfo)
{
AutoCompleteEntry completion = null;//m_context.Row >= token.Line
completion = new AutoCompleteEntry {
Depth = m_memory.Depth,
Token = token,
AllowedContext = definitionInfo.AllowedContext,
Definitions = new [] { definitionInfo.Definition }
};
if(m_context.AutoCompleteMatches != null && Match(token) && (token.PostWhiteSpace == null || MatchPost(token) /*(m_context.Row < token.PostWhiteSpace.Line && !(token.PostWhiteSpace.Line == m_context.Row && token.PostWhiteSpace.Character > m_context.Column))*/)) {
m_context.AutoCompleteMatches.RemoveAll(m => m.Depth >= m_memory.Depth);
m_context.AutoCompleteMatches.Add(completion);
} else {
completion.SemTokensOnly = true;
}
AutoCompleteEntry completion = null;
if(token is LiteralToken lit && lit.RawData != null) {
completion = new AutoCompleteEntry {
Depth = m_memory.Depth,
Token = token,
AllowedContext = definitionInfo.AllowedContext,
Definitions = new [] { definitionInfo.Definition }
};
if(m_context.AutoCompleteMatches != null && Match(token) && (token.PostWhiteSpace == null || MatchPost(token) /*(m_context.Row < token.PostWhiteSpace.Line && !(token.PostWhiteSpace.Line == m_context.Row && token.PostWhiteSpace.Character > m_context.Column))*/)) {
m_context.AutoCompleteMatches.RemoveAll(m => m.Depth >= m_memory.Depth);
m_context.AutoCompleteMatches.Add(completion);
} else {
completion.SemTokensOnly = true;
}
var rand = new Random();
string C = "CX";
while(lit.RawData.Contains(C)) {
Expand Down Expand Up @@ -692,7 +692,7 @@
// An expression starts here:
if (i == startExpression)
{
if(completion.Mapping?.Length > startExpression && token.Line != null && token.Column != null) {
if(completion?.Mapping?.Length > startExpression && token.Line != null && token.Column != null) {
var (r, c) = completion.Mapping[startExpression];
m_context.AddSemToken(r, c, 3, 5, 0);
}
Expand Down Expand Up @@ -739,7 +739,7 @@
endExpression - startExpression + 1 - TemplateConstants.OpenExpression.Length - TemplateConstants.CloseExpression.Length);
var expression = ParseExpression(completion, token.Line, token.Column, rawExpression, allowedContext, out Exception ex);

if(completion.Mapping?.Length >= endExpression - 1 && hasEnd && token.Line != null && token.Column != null) {
if(completion?.Mapping?.Length >= endExpression - 1 && hasEnd && token.Line != null && token.Column != null) {
var (r, c) = completion.Mapping[endExpression - 1];
m_context.AddSemToken(r, c, 2, 5, 0);
}
Expand Down Expand Up @@ -901,44 +901,6 @@
return true;
}

private static int GetIdxOfExpression(LiteralToken lit, int row, int column)
{
var lc = column - lit.Column;
var lr = row - lit.Line;
var rand = new Random();
string C = "CX";
while(lit.RawData.Contains(C)) {
C = rand.Next(255).ToString("X2");
}
var xraw = lit.RawData;
var idx = 0;
for(int i = 0; i < lr; i++) {
var n = xraw.IndexOf('\n', idx);
if(n == -1) {
return -1;
}
idx = n + 1;
}
idx += idx == 0 ? lc ?? 0 : column - 1;
if(idx > xraw.Length) {
return -1;
}
xraw = xraw.Insert(idx, C);

var scanner = new YamlDotNet.Core.Scanner(new StringReader(xraw), true);
try {
while(scanner.MoveNext()) {
if(scanner.Current is YamlDotNet.Core.Tokens.Scalar s) {
var x = s.Value;
return x.IndexOf(C);
}
}
} catch {

}
return -1;
}

private ExpressionToken ParseExpression(
AutoCompleteEntry completion,
Int32? line,
Expand Down Expand Up @@ -1200,11 +1162,11 @@
return m_schema.Get<T>(Definition);
}

public Definition? Parent { get; }

Check warning on line 1165 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (alpine-x64, true)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1165 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (alpine-arm, true)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1165 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (linux-x64, true)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1165 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (linux-arm, true)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1165 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (linux-arm64, true)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1165 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (linux-x64, false)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1165 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (alpine-arm64, true)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1165 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / package

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1165 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (linux-arm64, false)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1165 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (linux-arm, false)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1165 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (alpine-x64, false)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1165 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (osx-arm64, true)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1165 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (osx-x64, true)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1165 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (osx-arm64, false)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1165 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (win-arm64, true)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1165 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (win-x64, true)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1165 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (alpine-arm64, false)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1165 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (alpine-arm, false)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1165 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (win-x86, true)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1165 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (win-arm64, false)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1165 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (win-x64, false)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1165 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (win-x86, false)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1165 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (osx-x64, false)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1165 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / deploy

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1165 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / deploy

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1165 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / CodeQL-Build

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
public string? ParentName { get; }

Check warning on line 1166 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (alpine-x64, true)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1166 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (alpine-arm, true)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1166 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (linux-x64, true)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1166 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (linux-arm, true)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1166 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (linux-arm64, true)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1166 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (linux-x64, false)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1166 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (alpine-arm64, true)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1166 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / package

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1166 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (linux-arm64, false)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1166 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (linux-arm, false)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1166 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (alpine-x64, false)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1166 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (osx-arm64, true)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1166 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (osx-x64, true)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1166 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (osx-arm64, false)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1166 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (win-arm64, true)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1166 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (win-x64, true)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1166 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (alpine-arm64, false)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1166 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (alpine-arm, false)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1166 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (win-x86, true)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1166 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (win-arm64, false)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1166 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (win-x64, false)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1166 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (win-x86, false)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1166 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (osx-x64, false)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1166 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / deploy

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1166 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / deploy

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1166 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / CodeQL-Build

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

private TemplateSchema m_schema;
public string? Name { get; }

Check warning on line 1169 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (alpine-x64, true)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1169 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (alpine-arm, true)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1169 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (linux-x64, true)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1169 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (linux-arm, true)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1169 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (linux-arm64, true)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1169 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (linux-x64, false)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1169 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (alpine-arm64, true)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1169 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / package

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1169 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (linux-arm64, false)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1169 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (linux-arm, false)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1169 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (alpine-x64, false)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1169 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (osx-arm64, true)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1169 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (osx-x64, true)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1169 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (osx-arm64, false)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1169 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (win-arm64, true)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1169 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (win-x64, true)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1169 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (alpine-arm64, false)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1169 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (alpine-arm, false)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1169 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (win-x86, true)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1169 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (win-arm64, false)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1169 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (win-x64, false)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1169 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (win-x86, false)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1169 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / build (osx-x64, false)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1169 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / deploy

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1169 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / deploy

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 1169 in src/Sdk/DTObjectTemplating/ObjectTemplating/TemplateReader.cs

View workflow job for this annotation

GitHub Actions / CodeQL-Build

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
public Definition Definition;
public String[] AllowedContext;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ internal YamlObjectReader(
bool yamlFold = false,
bool yamlMerge = false,
bool preserveString = false,
bool forceAzurePipelines = false) : this(fileId, new StringReader(input), yamlAnchors, yamlFold, yamlMerge, preserveString, forceAzurePipelines)
bool forceAzurePipelines = false,
bool rawMapping = false) : this(fileId, new StringReader(input), yamlAnchors, yamlFold, yamlMerge, preserveString, forceAzurePipelines)
{
m_rawInput = input;
m_rawInput = rawMapping ? input : null;
}

private string GetScalarStringValue(Scalar scalar) {
Expand Down
4 changes: 4 additions & 0 deletions src/azure-pipelines-vscode-ext/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### v0.2.3
- fix degraded performance due to disabled new features added in the v0.2.x extension
- fix Check Manually for Syntax Errors

### v0.2.2
- fix an issue that could cause the v0.2.x extension to hang forever

Expand Down
5 changes: 3 additions & 2 deletions src/azure-pipelines-vscode-ext/ext-core/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
}

[MethodImpl(MethodImplOptions.NoInlining)]
[JSExport]

Check warning on line 86 in src/azure-pipelines-vscode-ext/ext-core/Program.cs

View workflow job for this annotation

GitHub Actions / deploy

This call site is reachable on all platforms. 'JSExportAttribute' is only supported on: 'browser'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 86 in src/azure-pipelines-vscode-ext/ext-core/Program.cs

View workflow job for this annotation

GitHub Actions / deploy

This call site is reachable on all platforms. 'JSExportAttribute' is only supported on: 'browser'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)
public static async Task<string> ExpandCurrentPipeline(JSObject handle, string currentFileName, string variables, string parameters, bool returnErrorContent, string schema) {
var context = new Runner.Server.Azure.Devops.Context {
FileProvider = new MyFileProvider(handle),
Expand Down Expand Up @@ -130,16 +130,17 @@
}

[MethodImpl(MethodImplOptions.NoInlining)]
[JSExport]

Check warning on line 133 in src/azure-pipelines-vscode-ext/ext-core/Program.cs

View workflow job for this annotation

GitHub Actions / deploy

This call site is reachable on all platforms. 'JSExportAttribute' is only supported on: 'browser'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 133 in src/azure-pipelines-vscode-ext/ext-core/Program.cs

View workflow job for this annotation

GitHub Actions / deploy

This call site is reachable on all platforms. 'JSExportAttribute' is only supported on: 'browser'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)
public static async Task ParseCurrentPipeline(JSObject handle, string currentFileName, string schemaName, int column, int row) {
public static async Task ParseCurrentPipeline(JSObject handle, string currentFileName, string schemaName, int column, int row, bool rawMapping) {
var context = new Context {
FileProvider = new MyFileProvider(handle),
TraceWriter = new TraceWriter(handle),
Flags = GitHub.DistributedTask.Expressions2.ExpressionFlags.DTExpressionsV1 | GitHub.DistributedTask.Expressions2.ExpressionFlags.ExtendedDirectives,
RequiredParametersProvider = new RequiredParametersProvider(handle),
VariablesProvider = new VariablesProvider { Variables = new Dictionary<string, string>() },
Column = column,
Row = row
Row = row,
RawMapping = rawMapping
};
var check = column == 0 && row == 0;
try {
Expand Down Expand Up @@ -202,7 +203,7 @@
}

[MethodImpl(MethodImplOptions.NoInlining)]
[JSExport]

Check warning on line 206 in src/azure-pipelines-vscode-ext/ext-core/Program.cs

View workflow job for this annotation

GitHub Actions / deploy

This call site is reachable on all platforms. 'JSExportAttribute' is only supported on: 'browser'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 206 in src/azure-pipelines-vscode-ext/ext-core/Program.cs

View workflow job for this annotation

GitHub Actions / deploy

This call site is reachable on all platforms. 'JSExportAttribute' is only supported on: 'browser'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)
public static string YAMLToJson(string content) {
try {
return AzurePipelinesUtils.YAMLToJson(content);
Expand Down
2 changes: 1 addition & 1 deletion src/azure-pipelines-vscode-ext/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ function activate(context) {
handle.enableSemTokens = autocompletelist && ('enableSemTokens' in autocompletelist);

var result = syntaxOnly
? await runtime.BINDING.bind_static_method("[ext-core] MyClass:ParseCurrentPipeline")(handle, filename, schema, pos ? pos.character + 1 : 0, pos ? pos.line + 1 : 0)
? await runtime.BINDING.bind_static_method("[ext-core] MyClass:ParseCurrentPipeline")(handle, filename, schema ?? null, pos ? pos.character + 1 : 0, pos ? pos.line + 1 : 0, (handle.enableSemTokens || pos) ? true : false)
: await runtime.BINDING.bind_static_method("[ext-core] MyClass:ExpandCurrentPipeline")(handle, filename, JSON.stringify(variables), JSON.stringify(parameters), (error && true) == true, schema)

if(pos) {
Expand Down
2 changes: 1 addition & 1 deletion src/azure-pipelines-vscode-ext/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"Programming Languages"
],
"icon": "pipeline-rocket.png",
"version": "0.2.2",
"version": "0.2.3",
"publisher": "christopherhx",
"repository": "https://github.com/ChristopherHX/runner.server",
"engines": {
Expand Down
Loading