File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,6 +10,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1010
1111- Added .keymap to support ZMK to list of file extensions for devicetree language.
1212
13+ ### Fixed
14+
15+ - Fixed ` Request devicetree/customActions failed with message: Cannot read properties of undefined (reading 'uri") `
16+ in VSCode when using context menu document to ` Copy C identifier `
17+
1318## [ 0.9.4] - 2026-05-22
1419
1520### Added
Original file line number Diff line number Diff line change @@ -18,8 +18,10 @@ import * as path from 'path';
1818import * as vscode from 'vscode' ;
1919
2020import {
21+ DocumentUri ,
2122 LanguageClient ,
2223 LanguageClientOptions ,
24+ Position ,
2325 ServerOptions ,
2426 TextDocumentPositionParams ,
2527 TransportKind ,
@@ -383,8 +385,21 @@ export async function activate(context: vscode.ExtensionContext) {
383385 vscode . commands . registerCommand (
384386 'devicetree.clipboard.dtMacro' ,
385387 async ( textDocumentPositionParams ?: TextDocumentPositionParams ) => {
388+ if (
389+ textDocumentPositionParams &&
390+ ( ! ( 'position' in textDocumentPositionParams ) ||
391+ ! ( 'textDocument' in textDocumentPositionParams ) ||
392+ ! Position . is ( textDocumentPositionParams . position ) ||
393+ ! DocumentUri . is (
394+ textDocumentPositionParams . textDocument . uri ,
395+ ) )
396+ ) {
397+ textDocumentPositionParams = undefined ;
398+ }
399+
386400 textDocumentPositionParams ??=
387401 getCurrentTextDocumentPositionParams ( ) ;
402+
388403 if ( ! textDocumentPositionParams ) {
389404 return ;
390405 }
Original file line number Diff line number Diff line change 1717import * as vscode from 'vscode' ;
1818import { TextDocumentPositionParams } from 'vscode-languageclient' ;
1919
20- export function getCurrentTextDocumentPositionParams ( ) {
20+ export function getCurrentTextDocumentPositionParams ( ) :
21+ | TextDocumentPositionParams
22+ | undefined {
2123 const editor = vscode . window . activeTextEditor ;
2224 if ( ! editor ) {
2325 return ;
@@ -31,5 +33,5 @@ export function getCurrentTextDocumentPositionParams() {
3133 line : editor . selection . active . line ,
3234 character : editor . selection . active . character ,
3335 } ,
34- } satisfies TextDocumentPositionParams ;
36+ } ;
3537}
You can’t perform that action at this time.
0 commit comments