Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Kate
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Utilities
Kate
Commits
94b5d277
Commit
94b5d277
authored
May 08, 2020
by
Kåre Särs
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'Fix-starting-LSP-on-Windows'
parents
2467f618
52c8285b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
11 deletions
+11
-11
addons/lspclient/lspclientpluginview.cpp
addons/lspclient/lspclientpluginview.cpp
+7
-7
addons/lspclient/lspclientserver.cpp
addons/lspclient/lspclientserver.cpp
+2
-2
addons/lspclient/tests/lsptestapp.cpp
addons/lspclient/tests/lsptestapp.cpp
+2
-2
No files found.
addons/lspclient/lspclientpluginview.cpp
View file @
94b5d277
...
...
@@ -176,7 +176,7 @@ class FileLineReader
public:
FileLineReader
(
const
QUrl
&
url
)
:
file
(
url
.
path
())
:
file
(
url
.
toLocalFile
())
{
file
.
open
(
QIODevice
::
ReadOnly
);
}
...
...
@@ -1015,7 +1015,7 @@ public:
for
(
const
auto
&
loc
:
locations
)
{
if
(
loc
.
uri
!=
lastUrl
)
{
if
(
parent
)
{
parent
->
setText
(
QStringLiteral
(
"%1: %2"
).
arg
(
lastUrl
.
path
()).
arg
(
parent
->
rowCount
()));
parent
->
setText
(
QStringLiteral
(
"%1: %2"
).
arg
(
lastUrl
.
toLocalFile
()).
arg
(
parent
->
rowCount
()));
}
lastUrl
=
loc
.
uri
;
parent
=
new
QStandardItem
();
...
...
@@ -1028,7 +1028,7 @@ public:
fillItemRoles
(
item
,
loc
.
uri
,
loc
.
range
,
loc
.
kind
,
snapshot
);
}
if
(
parent
)
parent
->
setText
(
QStringLiteral
(
"%1: %2"
).
arg
(
lastUrl
.
path
()).
arg
(
parent
->
rowCount
()));
parent
->
setText
(
QStringLiteral
(
"%1: %2"
).
arg
(
lastUrl
.
toLocalFile
()).
arg
(
parent
->
rowCount
()));
// plain heuristic; mark for auto-expand all when safe and/or useful to do so
if
(
treeModel
->
rowCount
()
<=
2
||
locations
.
size
()
<=
20
)
{
...
...
@@ -1372,7 +1372,7 @@ public:
static
QStandardItem
*
getItem
(
const
QStandardItemModel
&
model
,
const
QUrl
&
url
)
{
auto
l
=
model
.
findItems
(
url
.
path
());
auto
l
=
model
.
findItems
(
url
.
toLocalFile
());
if
(
l
.
length
())
{
return
l
.
at
(
0
);
}
...
...
@@ -1463,7 +1463,7 @@ public:
}
topItem
=
new
QStandardItem
();
model
->
appendRow
(
topItem
);
topItem
->
setText
(
diagnostics
.
uri
.
path
());
topItem
->
setText
(
diagnostics
.
uri
.
toLocalFile
());
}
else
{
topItem
->
setRowCount
(
0
);
}
...
...
@@ -1485,7 +1485,7 @@ public:
}
auto
relatedItemMessage
=
new
QStandardItem
();
fillItemRoles
(
relatedItemMessage
,
related
.
location
.
uri
,
related
.
location
.
range
,
RangeData
::
KindEnum
::
Related
);
auto
basename
=
QFileInfo
(
related
.
location
.
uri
.
path
()).
fileName
();
auto
basename
=
QFileInfo
(
related
.
location
.
uri
.
toLocalFile
()).
fileName
();
auto
location
=
QStringLiteral
(
"%1:%2"
).
arg
(
basename
).
arg
(
related
.
location
.
range
.
start
().
line
());
relatedItemMessage
->
setText
(
QStringLiteral
(
"[%1] %2"
).
arg
(
location
).
arg
(
related
.
message
));
relatedItemMessage
->
setData
(
diagnosticsIcon
(
LSPDiagnosticSeverity
::
Information
),
Qt
::
DecorationRole
);
...
...
@@ -1756,7 +1756,7 @@ public:
QSet
<
QString
>
fpaths
;
for
(
const
auto
&
view
:
m_mainWindow
->
views
())
{
if
(
auto
doc
=
view
->
document
())
{
fpaths
.
insert
(
doc
->
url
().
path
());
fpaths
.
insert
(
doc
->
url
().
toLocalFile
());
}
}
// check and clear defunct entries
...
...
addons/lspclient/lspclientserver.cpp
View file @
94b5d277
...
...
@@ -1016,7 +1016,7 @@ private:
// NOTE a typical server does not use root all that much,
// other than for some corner case (in) requests
QJsonObject
params
{{
QStringLiteral
(
"processId"
),
QCoreApplication
::
applicationPid
()},
{
QStringLiteral
(
"rootPath"
),
m_root
.
path
()},
{
QStringLiteral
(
"rootPath"
),
m_root
.
toLocalFile
()},
{
QStringLiteral
(
"rootUri"
),
m_root
.
toString
()},
{
QStringLiteral
(
"capabilities"
),
capabilities
},
{
QStringLiteral
(
"initializationOptions"
),
m_init
}};
...
...
@@ -1042,7 +1042,7 @@ public:
qCInfo
(
LSPCLIENT
)
<<
"starting"
<<
m_server
<<
"with root"
<<
m_root
;
// start LSP server in project root
m_sproc
.
setWorkingDirectory
(
m_root
.
path
());
m_sproc
.
setWorkingDirectory
(
m_root
.
toLocalFile
());
// at least we see some errors somewhere then
m_sproc
.
setProcessChannelMode
(
QProcess
::
ForwardedErrorChannel
);
...
...
addons/lspclient/tests/lsptestapp.cpp
View file @
94b5d277
...
...
@@ -50,13 +50,13 @@ int main(int argc, char **argv)
q
.
exec
();
QObject
::
disconnect
(
conn
);
auto
diagnostics_h
=
[](
const
LSPPublishDiagnosticsParams
&
diag
)
{
std
::
cout
<<
"diagnostics "
<<
diag
.
uri
.
path
().
toUtf8
().
toStdString
()
<<
" count: "
<<
diag
.
diagnostics
.
length
();
};
auto
diagnostics_h
=
[](
const
LSPPublishDiagnosticsParams
&
diag
)
{
std
::
cout
<<
"diagnostics "
<<
diag
.
uri
.
toLocalFile
().
toUtf8
().
toStdString
()
<<
" count: "
<<
diag
.
diagnostics
.
length
();
};
QObject
::
connect
(
&
lsp
,
&
LSPClientServer
::
publishDiagnostics
,
diagnostics_h
);
auto
document
=
QUrl
(
QString
::
fromLatin1
(
argv
[
3
]));
QFile
file
(
document
.
path
());
QFile
file
(
document
.
toLocalFile
());
if
(
!
file
.
open
(
QIODevice
::
ReadOnly
|
QIODevice
::
Text
))
return
-
1
;
QTextStream
in
(
&
file
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment