diff --git a/server/Oraide.LanguageServer/LanguageServerProtocolHandlers/TextDocument/TextDocumentCompletionHandler.cs b/server/Oraide.LanguageServer/LanguageServerProtocolHandlers/TextDocument/TextDocumentCompletionHandler.cs index 6d79688..3b8820c 100644 --- a/server/Oraide.LanguageServer/LanguageServerProtocolHandlers/TextDocument/TextDocumentCompletionHandler.cs +++ b/server/Oraide.LanguageServer/LanguageServerProtocolHandlers/TextDocument/TextDocumentCompletionHandler.cs @@ -303,7 +303,7 @@ protected override IEnumerable HandleRulesValue(CursorTarget cur // NOTE: This will improve if/when we add the attribute. if (traitInfo.TraitPropertyInfos.Any(x => x.OtherAttributes.Any(y => y.Name == "SequenceReference" && y.Value != null - && y.Value.Contains(',') ? y.Value.Substring(0, y.Value.IndexOf(',')) == fieldInfo.Name : y.Value == fieldInfo.Name))) + && (y.Value.Contains(',') ? y.Value.Substring(0, y.Value.IndexOf(',')) == fieldInfo.Name : y.Value == fieldInfo.Name)))) { return spriteSequenceImageNames; } @@ -442,7 +442,7 @@ protected override IEnumerable HandleWeaponValue(CursorTarget cu // Pretend there is such a thing as a "SequenceImageReferenceAttribute" until we add it in OpenRA one day. // NOTE: This will improve if/when we add the attribute. if (fieldInfos.Any(x => x.OtherAttributes.Any(y => y.Name == "SequenceReference" - && y.Value.Contains(',') ? y.Value.Substring(0, y.Value.IndexOf(',')) == fieldInfo.Name : y.Value == fieldInfo.Name))) + && (y.Value.Contains(',') ? y.Value.Substring(0, y.Value.IndexOf(',')) == fieldInfo.Name : y.Value == fieldInfo.Name)))) { return spriteSequenceImageNames; } diff --git a/server/Oraide.LanguageServer/LanguageServerProtocolHandlers/TextDocument/TextDocumentDefinitionHandler.cs b/server/Oraide.LanguageServer/LanguageServerProtocolHandlers/TextDocument/TextDocumentDefinitionHandler.cs index e17b57f..aaab872 100644 --- a/server/Oraide.LanguageServer/LanguageServerProtocolHandlers/TextDocument/TextDocumentDefinitionHandler.cs +++ b/server/Oraide.LanguageServer/LanguageServerProtocolHandlers/TextDocument/TextDocumentDefinitionHandler.cs @@ -187,7 +187,7 @@ protected override IEnumerable HandleRulesValue(CursorTarget cursorTar // Pretend there is such a thing as a "SequenceImageReferenceAttribute" until we add it in OpenRA one day. // NOTE: This will improve if/when we add the attribute. if (traitInfo.TraitPropertyInfos.Any(x => x.OtherAttributes.Any(y => y.Name == "SequenceReference" - && y.Value.Contains(',') ? y.Value.Substring(0, y.Value.IndexOf(',')) == fieldInfo.Name : y.Value == fieldInfo.Name))) + && (y.Value.Contains(',') ? y.Value.Substring(0, y.Value.IndexOf(',')) == fieldInfo.Name : y.Value == fieldInfo.Name)))) { return spriteSequenceImageDefinitions[cursorTarget.TargetString].Select(x => x.Location.ToLspLocation(x.Name.Length)); } @@ -360,7 +360,7 @@ protected override IEnumerable HandleWeaponValue(CursorTarget cursorTa // Pretend there is such a thing as a "SequenceImageReferenceAttribute" until we add it in OpenRA one day. // NOTE: This will improve if/when we add the attribute. if (fieldInfos.Any(x => x.OtherAttributes.Any(y => y.Name == "SequenceReference" - && y.Value.Contains(',') ? y.Value.Substring(0, y.Value.IndexOf(',')) == fieldInfo.Name : y.Value == fieldInfo.Name))) + && (y.Value.Contains(',') ? y.Value.Substring(0, y.Value.IndexOf(',')) == fieldInfo.Name : y.Value == fieldInfo.Name)))) { return spriteSequenceImageDefinitions[cursorTarget.TargetString].Select(x => x.Location.ToLspLocation(x.Name.Length)); } diff --git a/server/Oraide.LanguageServer/LanguageServerProtocolHandlers/TextDocument/TextDocumentHoverHandler.cs b/server/Oraide.LanguageServer/LanguageServerProtocolHandlers/TextDocument/TextDocumentHoverHandler.cs index 658fbf9..cb122f5 100644 --- a/server/Oraide.LanguageServer/LanguageServerProtocolHandlers/TextDocument/TextDocumentHoverHandler.cs +++ b/server/Oraide.LanguageServer/LanguageServerProtocolHandlers/TextDocument/TextDocumentHoverHandler.cs @@ -236,7 +236,7 @@ protected override Hover HandleRulesValue(CursorTarget cursorTarget) // Pretend there is such a thing as a "SequenceImageReferenceAttribute" until we add it in OpenRA one day. // NOTE: This will improve if/when we add the attribute. if (traitInfo.TraitPropertyInfos.Any(x => x.OtherAttributes.Any(y => y.Name == "SequenceReference" - && y.Value.Contains(',') ? y.Value.Substring(0, y.Value.IndexOf(',')) == fieldInfo.Name : y.Value == fieldInfo.Name)) + && (y.Value.Contains(',') ? y.Value.Substring(0, y.Value.IndexOf(',')) == fieldInfo.Name : y.Value == fieldInfo.Name))) && spriteSequenceImageDefinitions.Contains(cursorTarget.TargetString)) { var image = spriteSequenceImageDefinitions[cursorTarget.TargetString].First(); @@ -482,7 +482,7 @@ protected override Hover HandleWeaponValue(CursorTarget cursorTarget) // Pretend there is such a thing as a "SequenceImageReferenceAttribute" until we add it in OpenRA one day. // NOTE: This will improve if/when we add the attribute. if (fieldInfos.Any(x => x.OtherAttributes.Any(y => y.Name == "SequenceReference" - && y.Value.Contains(',') ? y.Value.Substring(0, y.Value.IndexOf(',')) == fieldInfo.Name : y.Value == fieldInfo.Name)) + && (y.Value.Contains(',') ? y.Value.Substring(0, y.Value.IndexOf(',')) == fieldInfo.Name : y.Value == fieldInfo.Name))) && spriteSequenceImageDefinitions.Contains(cursorTarget.TargetString)) { var image = spriteSequenceImageDefinitions[cursorTarget.TargetString].First();