Skip to content

Commit

Permalink
updated rename lib
Browse files Browse the repository at this point in the history
fixed error reporting
  • Loading branch information
AlexHaxe committed Nov 24, 2024
1 parent 400874a commit 91526fb
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 9 deletions.
4 changes: 2 additions & 2 deletions haxe_libraries/rename.hxml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# @install: lix --silent download "gh://github.com/HaxeCheckstyle/haxe-rename#bcb4112911ca3d70bf847c951381282a272add18" into rename/2.3.1/github/bcb4112911ca3d70bf847c951381282a272add18
-cp ${HAXE_LIBCACHE}/rename/2.3.1/github/bcb4112911ca3d70bf847c951381282a272add18/src
# @install: lix --silent download "gh://github.com/HaxeCheckstyle/haxe-rename#19b2667de5d5302e6f3a7e650efcb7771d11082d" into rename/2.3.1/github/19b2667de5d5302e6f3a7e650efcb7771d11082d
-cp ${HAXE_LIBCACHE}/rename/2.3.1/github/19b2667de5d5302e6f3a7e650efcb7771d11082d/src
-D rename=2.3.1
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class CodeActionFeature {
refactorFeature.createCodeActionEdits(context, type, action, params).then(workspaceEdit -> {
action.edit = workspaceEdit;
resolve(action);
});
}).catchError((e) -> reject(e));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import haxe.display.Display.HoverDisplayItemOccurence;
import haxe.display.JsonModuleTypes.JsonType;
import haxeLanguageServer.protocol.DisplayPrinter;
import js.lib.Promise;
import refactor.ITypeList;
import refactor.ITyper;
import refactor.TypingHelper.TypeHintType;
import refactor.typing.ITypeList;
import refactor.typing.ITyper;
import refactor.typing.TypeHintType;

using Lambda;
using haxeLanguageServer.helper.PathHelper;
Expand Down
19 changes: 16 additions & 3 deletions src/haxeLanguageServer/features/haxe/refactoring/RefactorCache.hx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package haxeLanguageServer.features.haxe.refactoring;

import haxe.Exception;
import haxe.PosInfos;
import haxe.display.Server.ServerMethods;
import haxe.io.Path;
Expand Down Expand Up @@ -103,8 +104,14 @@ class RefactorCache {
final workspacePath = context.workspacePath.normalize();
final srcFolders = classPaths.map(f -> Path.join([workspacePath.toString(), f]));

TraverseSources.traverseSources(srcFolders, usageContext);
usageContext.usageCollector.updateImportHx(usageContext);
try {
TraverseSources.traverseSources(srcFolders, usageContext);
usageContext.usageCollector.updateImportHx(usageContext);
} catch (e:Exception) {
#if debug
trace("failed to updateFileCache: " + e);
#end
}

endProgress();
}
Expand All @@ -116,7 +123,13 @@ class RefactorCache {
public function updateSingleFileCache(uri:String) {
final usageContext:UsageContext = makeUsageContext();
usageContext.fileName = uri;
TraverseSources.collectIdentifierData(usageContext);
try {
TraverseSources.collectIdentifierData(usageContext);
} catch (e:Exception) {
#if debug
trace("failed to updateSingleFileCache: " + e);
#end
}
}

public function invalidateFile(uri:String) {
Expand Down

0 comments on commit 91526fb

Please sign in to comment.