Skip to content

CodeAssist 3.14.0

Latest

Choose a tag to compare

@tyron12233 tyron12233 released this 05 Sep 20:44
· 1 commit to main since this release

CodeAssist 3.14.0

This release is mostly about the editor keeping up with you. Kotlin analysis was re-checking the whole file on every keystroke, and on a file that is one class, which is most Kotlin files, that was all of it. It now re-checks the one member you are typing in.

A faster Kotlin editor

  • Typing inside a class no longer re-analyses the class. The editor already reused the parts of a file an edit could not affect, but only between top level declarations, and it treated any keystroke inside a class as a change to the class itself. A file holding a single class therefore got no reuse at all. Diagnostics and syntax colouring now reuse every member you did not touch, and inside the method you are editing they still reuse the statements you did not touch.
  • On a 30 method class, one keystroke went from 27ms and 16.7MB of garbage to 3.6ms and 419KB.
  • Type name resolution is cached. Working out what a name refers to walks the imports, the package, the star imports and the classpath index, and it was doing that once per reference rather than once per name. Every editor pass over the same snapshot now shares one cache.
  • A call that clearly resolves to a function no longer gets checked as if it might be a constructor, which was the single most expensive check in the pass.

Plugins can run your code

  • A plugin can now interpret the project's Kotlin, through the new published interp-api. A source session runs the buffer you are typing in with no compile or dex step, and a bytecode session runs compiled classes. This is the machinery the Compose preview uses, now available to a plugin for a framework with a render loop of its own.
  • InterpretedObject.proxy hands an interpreted object out as a real implementation of a real interface, so a framework that owns an object's lifecycle can hold your class.
  • A plugin app you install or update is noticed while the IDE is running. Updating a plugin in place used to have no visible effect at all, because the loaded classloader kept reading the old install path, and turning the plugin off and on again did nothing. The Plugins screen now names what is waiting and applies it with one restart.
  • A plugin can supply its own language's analysis inputs, and the project model's registries and vocabularies are open to plugins rather than closed.
  • The plugin SPI is published at 2.1.0, and the docs now show a run graph a plugin can actually build.

Compose preview

  • Typing in a previewed file can no longer freeze the IDE. Half written code could reach the live Compose runtime: a preview whose entry function stayed valid while a helper you were editing had a gap would skip that statement mid composition, after Compose groups were already open, and the unbalanced composer took the IDE down later. Broken code is now never interpreted, for every caller.
  • An interpreted enum class is now a real enum at runtime, so values(), entries and anything switching over it behave.
  • A call with a named argument before positional ones keeps the overload it resolved to.

Dependencies and build

  • Native libraries published per ABI can now be declared. Artifacts addressed by a Maven classifier, like com.badlogicgames.gdx:gdx-platform:natives-arm64-v8a, could not even be written down before, and the plain coordinate resolved successfully to nothing. Coordinates carry a classifier now, and a new natives scope packages them into the APK.
  • Room 3 is supported. androidx.room3 is a separate artifact group with its own annotations rather than a version bump, so it needs its own bundled processor.
  • A bundled annotation processor now checks the runtime you declared per member, not just per class, which catches the case where a type exists but a newer revision added something the generated code names. That failure used to surface as a crash inside annotation processing rather than a clear error.
  • A dependency coordinate pasted with an invisible zero width space in it now resolves instead of reporting a mysterious 404.

Kotlin fixes

  • Nested types resolve by their simple name from inside the enclosing class body, and when they are inherited from a supertype.
  • Nested library types can be imported by their simple name. LayoutParams, Map.Entry, AnimatorListener and every other nested type were missing from the index entirely, so the unresolved reference came with no Import fix beside it.
  • An object literal whose supertype is not imported reports only the missing reference, instead of adding a contradictory type mismatch that underlined the whole literal and buried the fix.
  • suspend fun main(): Unit = coroutineScope { launch { } } is no longer a type mismatch.
  • A const val initialised from a constant string template is accepted.
  • Completion ranks your own project's types above library ones.
  • Two hangs are gone: a self referential type parameter bound no longer runs the constraint solver forever, and a stack exhaustion is no longer cached as "this declaration has no type".

Also

  • Copy the whole Logcat buffer in one tap. The Logcat tab had no copy button, and its buffer was skipped by the console header's, so the only way out was selecting rows by hand. Useful for capturing a run off a device with no adb.

Full changelog: https://github.com/tyron12233/CodeAssist/releases/tag/v3.14.0