Skip to content
Open
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
12 changes: 6 additions & 6 deletions src/protocol/LSP.Basic.pas
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,8 @@ TDiagnostic = class (TCollectionItem)
private
fRange: TRange;
fSeverity: TDiagnosticSeverity;
fCode: integer;
fSource: string;
fCode: TOptionalInteger;
fSource: TOptionalString;
fMessage: string;
procedure SetRange(AValue: TRange);
Public
Expand All @@ -391,10 +391,10 @@ TDiagnostic = class (TCollectionItem)
// client to interpret diagnostics as error, warning, info or hint.
property severity: TDiagnosticSeverity read fSeverity write fSeverity;
// The diagnostic's code, which might appear in the user interface.
property code: integer read fCode write fCode;
property code: TOptionalInteger read fCode write fCode;
// A human-readable string describing the source of this
// diagnostic, e.g. 'typescript' or 'super lint'.
property source: string read fSource write fSource;
property source: TOptionalString read fSource write fSource;
// The diagnostic's message.
property message: string read fMessage write fMessage;

Expand Down Expand Up @@ -1107,12 +1107,12 @@ procedure TDiagnostic.Assign(Source : TPersistent);
Severity:=Src.severity;
Code:=Src.Code;
self.Source:=Src.Source;
Message:=Src.Source;
if Src.source.HasValue then
Message:=Src.Source.Value;
end
else
inherited Assign(Source);
end;


end.

16 changes: 8 additions & 8 deletions src/protocol/LSP.Completion.pas
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,12 @@ TCompletionItem = class(TCollectionItem)
fLabel: string;
fKind: TCompletionItemKind;
fTags: TCompletionItemTags;
fDetail: string;
fDetail: TOptionalString;
fDocumentation: TMarkupContent;
fPreselect: Boolean;
fSortText: string;
fFilterText: string;
fInsertText: string;
fSortText: TOptionalString;
fFilterText: TOptionalString;
fInsertText: TOptionalString;
fInsertTextFormat: TInsertTextFormat;
fTextEdit: TTextEdit;
fAdditionalTextEdits: TTextEdits;
Expand All @@ -184,7 +184,7 @@ TCompletionItem = class(TCollectionItem)
property tags: TCompletionItemTags read fTags write fTags;
// A human-readable string with additional information about this
// item, like type or symbol information.
property detail: string read fDetail write fDetail;
property detail: TOptionalString read fDetail write fDetail;
// A human-readable string that represents a doc-comment.
property documentation: TMarkupContent read fDocumentation write SetDocumentation;
// Select this item when showing.
Expand All @@ -195,10 +195,10 @@ TCompletionItem = class(TCollectionItem)
property preselect: Boolean read fPreselect write fPreselect;
// A string that should be used when comparing this item
// with other items. When `falsy` the label is used.
property sortText: string read fSortText write fSortText;
property sortText: TOptionalString read fSortText write fSortText;
// A string that should be used when filtering a set of
// completion items. When `falsy` the label is used.
property filterText: string read fFilterText write fFilterText;
property filterText: TOptionalString read fFilterText write fFilterText;
// A string that should be inserted into a document when selecting
// this completion. When `falsy` the label is used.
//
Expand All @@ -209,7 +209,7 @@ TCompletionItem = class(TCollectionItem)
// `insertText` of `console` is provided it will only insert
// `sole`. Therefore it is recommended to use `textEdit` instead
// since it avoids additional client side interpretation.
property insertText: string read fInsertText write fInsertText;
property insertText: TOptionalString read fInsertText write fInsertText;
// The format of the insert text. The format applies to both the
// `insertText` property and the `newText` property of a provided
// `textEdit`. If omitted defaults to
Expand Down
4 changes: 2 additions & 2 deletions src/protocol/LSP.DocumentSymbol.pas
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ TDocumentSymbol = class;
TDocumentSymbol = class(TCollectionItem)
private
fName: string;
fDetail: string;
fDetail: TOptionalString;
fKind: TSymbolKind;
fDeprecated: boolean;
fRange: TRange;
Expand All @@ -92,7 +92,7 @@ TDocumentSymbol = class(TCollectionItem)
// an empty string or a string only consisting of white spaces.
property name: string read fName write fName;
// More detail for this symbol, e.g the signature of a function.
property detail: string read fDetail write fDetail;
property detail: TOptionalString read fDetail write fDetail;
// The kind of this symbol.
property kind: TSymbolKind read fKind write fKind;
// Indicates if this symbol is deprecated.
Expand Down
4 changes: 2 additions & 2 deletions src/protocol/LSP.General.pas
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ TVoidParams = class(TLSPStreamable);
TClientInfo = class(TLSPStreamable)
private
fName: string;
fVersion: string;
fVersion: TOptionalString;
Public
Procedure Assign(aSource : TPersistent); override;
published
// The name of the client as defined by the client.
property name: string read fName write fName;
// The client's version as defined by the client.
property version: string read fVersion write fVersion;
property version: TOptionalString read fVersion write fVersion;
end;


Expand Down
4 changes: 2 additions & 2 deletions src/protocol/LSP.InlayHint.pas
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ TInlayHint = class(TCollectionItem)
fLabel: String; // string | InlayHintLabelPart[] (not supported now)
fKind: TOptionalInlayHintKind;
fTextEdits: TTextEdits;
fTooltip: String;
fTooltip: TOptionalString;
public
Constructor Create(ACollection: TCollection); override;
published
Expand Down Expand Up @@ -81,7 +81,7 @@ TInlayHint = class(TCollectionItem)
//
// Depending on the client capability `inlayHint.resolveSupport` clients
// might resolve this property late using the resolve request.
property tooltip: String read fTooltip write fTooltip;
property tooltip: TOptionalString read fTooltip write fTooltip;
public
destructor Destroy; override;
end;
Expand Down
8 changes: 7 additions & 1 deletion src/serverprotocol/PasLS.General.pas
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,17 @@ procedure TInitialize.CollectWorkSpacePaths(WorkspaceFolders: TWorkspaceFolderIt
procedure TInitialize.ShowConfigStatus(Params: TInitializeParams; CodeToolsOptions: TCodeToolsOptions);
var
ExcludeList, Option: String;
clientInfoVersion: String;
I: Integer;
FPCOptions: TStringArray;
begin
if Params.clientInfo.version.HasValue then
clientInfoVersion := ' ' + Params.clientInfo.version.Value
else
clientInfoVersion := '';

DoLog(kStatusPrefix+'Server: ' + {$INCLUDE %DATE%});
DoLog(kStatusPrefix+'Client: ' + Params.clientInfo.name + ' ' + Params.clientInfo.version);
DoLog(kStatusPrefix+'Client: ' + Params.clientInfo.name + clientInfoVersion);

DoLog(kStatusPrefix+'FPCPath: ' + CodeToolsOptions.FPCPath);
DoLog(kStatusPrefix+'FPCSrcDir: ' + CodeToolsOptions.FPCSrcDir);
Expand Down
1 change: 0 additions & 1 deletion src/serverprotocol/lspserver.pas
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ interface
PasLS.DocumentSymbol, PasLS.Commands, PasLS.Formatter, PasLS.ExecuteCommand,
PasLS.CodeUtils, PasLS.InvertAssign, PasLS.LazConfig, PasLS.Parser,
PasLS.Symbols, PasLS.CheckInactiveRegions, PasLS.InactiveRegions,
PasLS.Command.RemoveUnusedUnits, PasLS.RemoveUnusedUnits,
PasLS.Rename, LazarusPackageIntf;

implementation
Expand Down