@@ -26,8 +26,12 @@ class CodeObjectHost(project: Project): LifetimedProjectComponent(project) {
2626
2727 // Note: using the file uri as the document key in rider protocol proved to be unstable because of
2828 // differences in conversion between linux and windows.
29- // so the document key is just its full path without the URI schema 'file:///'
30- // the Document has a fileUri field which is a uri with schema and is used to find a psi file in rider the frontend.
29+ // when running on windows the file:// schema has different number of slashes between resharper and the jvm,
30+ // and so it's not possible to use it as a map key in both sides.
31+ // so the document key is just its full path without the URI schema 'file:///', in resharper we use just the path
32+ // as the map key and in java we take the path from the PsiFile.
33+ // the Document has a fileUri field which is an uri with schema and is used to find a psi file in rider frontend.
34+ // PsuUtil.uriToPsiFile work ok with both the uri from resharper and the uri in the jvm side.
3135
3236
3337 fun getDocument (psiFile : PsiFile ): DocumentInfo ? {
@@ -121,7 +125,7 @@ class CodeObjectHost(project: Project): LifetimedProjectComponent(project) {
121125
122126
123127 private fun Document.toDocumentInfo () = DocumentInfo (
124- fileUri = fileUri,
128+ fileUri = normalizeFileUri( fileUri,project) ,
125129 methods = toMethodInfoMap(methods)
126130
127131 )
@@ -140,7 +144,7 @@ class CodeObjectHost(project: Project): LifetimedProjectComponent(project) {
140144 name = name,
141145 containingClass = containingClass,
142146 containingNamespace = containingNamespace,
143- containingFileUri = containingFileUri,
147+ containingFileUri = normalizeFileUri( containingFileUri,project) ,
144148 offsetAtFileUri = offsetAtFileUri,
145149 spans = toSpansList(spans)
146150 )
@@ -157,7 +161,7 @@ class CodeObjectHost(project: Project): LifetimedProjectComponent(project) {
157161 id = id,
158162 name = name,
159163 containingMethod = containingMethod,
160- containingFileUri = containingFileUri
164+ containingFileUri = normalizeFileUri( containingFileUri,project)
161165 )
162166
163167
0 commit comments