diff --git a/autoload/vimspector/internal/channel.vim b/autoload/vimspector/internal/channel.vim index b05d8e8..b44436b 100644 --- a/autoload/vimspector/internal/channel.vim +++ b/autoload/vimspector/internal/channel.vim @@ -62,7 +62,7 @@ function! vimspector#internal#channel#StartDebugSession( config ) abort \ ) endif - let l:addr = get( a:config, 'host', 'localhost' ) . ':' . a:config[ 'port' ] + let l:addr = get( a:config, 'host', '127.0.0.1' ) . ':' . a:config[ 'port' ] echo 'Connecting to ' . l:addr . '... (waiting fo up to 10 seconds)' let s:ch = ch_open( l:addr, diff --git a/autoload/vimspector/internal/neochannel.vim b/autoload/vimspector/internal/neochannel.vim index 5414568..f20684d 100644 --- a/autoload/vimspector/internal/neochannel.vim +++ b/autoload/vimspector/internal/neochannel.vim @@ -66,7 +66,7 @@ function! vimspector#internal#neochannel#StartDebugSession( config ) abort endtry endif - let l:addr = get( a:config, 'host', 'localhost' ) . ':' . a:config[ 'port' ] + let l:addr = get( a:config, 'host', '127.0.0.1' ) . ':' . a:config[ 'port' ] let attempt = 1 while attempt <= 10 diff --git a/docs/schema/vimspector.schema.json b/docs/schema/vimspector.schema.json index 97fea75..cd79f11 100644 --- a/docs/schema/vimspector.schema.json +++ b/docs/schema/vimspector.schema.json @@ -200,7 +200,7 @@ "properties": { "host": { "type": "string", - "default": "localhost", + "default": "127.0.0.1", "description": "Connect to this host in multi-session mode" }, "port": { diff --git a/python3/vimspector/installer.py b/python3/vimspector/installer.py index f27f46e..f0f85a4 100644 --- a/python3/vimspector/installer.py +++ b/python3/vimspector/installer.py @@ -344,11 +344,12 @@ def WriteAdapters( all_adapters, to_file=None ): def InstallGeneric( name, root, gadget ): - extension = os.path.join( root, 'extension' ) + extension_path = gadget.get( 'extension_path', 'extension' ) + extension = os.path.join( root, extension_path ) for f in gadget.get( 'make_executable', [] ): MakeExecutable( os.path.join( extension, f ) ) - MakeExtensionSymlink( name, root ) + MakeExtensionSymlink( name, root, extension_path ) def InstallCppTools( name, root, gadget ): @@ -703,8 +704,8 @@ def ExtractZipTo( file_path, destination, format ): CheckCall( [ 'tar', 'zxvf', file_path ] ) -def MakeExtensionSymlink( name, root ): - MakeSymlink( name, os.path.join( root, 'extension' ) ), +def MakeExtensionSymlink( name, root, extension_path = 'extension' ): + MakeSymlink( name, os.path.join( root, extension_path ) ), def MakeSymlink( link, pointing_to, in_folder = None ): diff --git a/python3/vimspector/stack_trace.py b/python3/vimspector/stack_trace.py index df650b9..f38e4ba 100644 --- a/python3/vimspector/stack_trace.py +++ b/python3/vimspector/stack_trace.py @@ -188,11 +188,12 @@ class StackTraceView( object ): return def consume_threads( message ): + requesting = False if self._requesting_threads == StackTraceView.ThreadRequestState.PENDING: # We may have hit a thread event, so try again. self._requesting_threads = StackTraceView.ThreadRequestState.NO self.LoadThreads( *self._pending_thread_request ) - return + requesting = True self._requesting_threads = StackTraceView.ThreadRequestState.NO self._pending_thread_request = None @@ -211,8 +212,6 @@ class StackTraceView( object ): stoppedThreadId = stopEvent.get( 'threadId' ) allThreadsStopped = stopEvent.get( 'allThreadsStopped', False ) - requesting = False - # FIXME: This is horribly inefficient for t in message[ 'body' ][ 'threads' ]: thread = None @@ -240,7 +239,10 @@ class StackTraceView( object ): # If this is a stopped event, load the stack trace for the "current" # thread. Don't do this on other thrads requests because some servers # just break when that happens. - if infer_current_frame: + # + # Don't do this if we're also satisfying a cached request already (we'll + # do it then) + if infer_current_frame and not requesting: if thread.id == self._current_thread: if thread.CanExpand(): self._LoadStackTrace( thread, True, reason ) diff --git a/support/test/kotlin/.gitignore b/support/test/kotlin/.gitignore new file mode 100644 index 0000000..f8b92c3 --- /dev/null +++ b/support/test/kotlin/.gitignore @@ -0,0 +1,2 @@ +.gradle +build diff --git a/support/test/kotlin/.vimspector.json b/support/test/kotlin/.vimspector.json new file mode 100644 index 0000000..d2c2a63 --- /dev/null +++ b/support/test/kotlin/.vimspector.json @@ -0,0 +1,21 @@ +{ + "configurations": { + "kotlin-debug-adapter launch": { + "adapter": "cust_kotlin-debug-adapter", + "configuration": { + "request": "launch", + "projectRoot": "${workspaceFolder}", + "mainClass": "vimspector/test/ApplicationKt" + } + }, + "kotlin-debug-adapter attach": { + "adapter": "cust_kotlin-debug-adapter", + "configuration": { + "request": "attach", + "projectRoot": "${workspaceFolder}", + "hostName": "${hostName}", + "port": "${port}" + } + } + } +} diff --git a/support/test/kotlin/build.gradle.kts b/support/test/kotlin/build.gradle.kts new file mode 100644 index 0000000..e93c004 --- /dev/null +++ b/support/test/kotlin/build.gradle.kts @@ -0,0 +1,25 @@ +plugins { + kotlin("jvm") version "1.4.0" + + application +} + +repositories { + // Use jcenter for resolving dependencies. + // You can declare any Maven/Ivy/file repository here. + jcenter() +} + +dependencies { + // Align versions of all Kotlin components + implementation(platform("org.jetbrains.kotlin:kotlin-bom")) + + // Use the Kotlin JDK 8 standard library. + implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8") +} + +application { + // Define the main class for the application. + mainClassName = "vimspector.test.ApplicationKt" +} + diff --git a/support/test/kotlin/settings.gradle.kts b/support/test/kotlin/settings.gradle.kts new file mode 100644 index 0000000..8cbc5be --- /dev/null +++ b/support/test/kotlin/settings.gradle.kts @@ -0,0 +1 @@ +rootProject.name = "vimspector-test" diff --git a/support/test/kotlin/src/main/kotlin/vimspector/test/Application.kt b/support/test/kotlin/src/main/kotlin/vimspector/test/Application.kt new file mode 100644 index 0000000..99655da --- /dev/null +++ b/support/test/kotlin/src/main/kotlin/vimspector/test/Application.kt @@ -0,0 +1,5 @@ +package vimspector.test + +fun main(args: Array) { + println("Hello World!") +} diff --git a/support/test/tcl/test b/support/test/tcl/test index e77a486..a77f56f 100644 --- a/support/test/tcl/test +++ b/support/test/tcl/test @@ -3,6 +3,8 @@ set SCALAR g array set ARRAY {key1 value1 key2 value2} +set LIST [list a b c {def} {g h i j} k l m] + proc Wrap { body } { uplevel 1 $body }