This is an automated email from the ASF dual-hosted git repository.

jhorvath pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git

commit c274d62846c12bfa0740381fedb58671ac827c85
Author: Ondřej Douda <ondrej.do...@oracle.com>
AuthorDate: Thu Jun 22 15:18:50 2023 +0200

    Test input for type.
---
 java/java.lsp.server/vscode/src/propertiesView/propertiesView.ts | 6 +++---
 java/java.lsp.server/vscode/src/typesUtil.ts                     | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/java/java.lsp.server/vscode/src/propertiesView/propertiesView.ts 
b/java/java.lsp.server/vscode/src/propertiesView/propertiesView.ts
index f195e62eee..248f3de17a 100644
--- a/java/java.lsp.server/vscode/src/propertiesView/propertiesView.ts
+++ b/java/java.lsp.server/vscode/src/propertiesView/propertiesView.ts
@@ -7,7 +7,7 @@
 
 import * as vscode from 'vscode';
 import { CommandKey, ID, Message, PropertyMessage, Properties, Property, 
PropertyTypes } from './controlTypes';
-import { assertNever, isRecord, isString, IsType } from '../typesUtil';
+import { assertNever, isObject, isRecord, isString, IsType } from 
'../typesUtil';
 import { makeHtmlForProperties } from './propertiesHtmlBuilder';
 
 export class PropertiesView {
@@ -109,8 +109,8 @@ export class PropertiesView {
        }
 
        private async get(): Promise<Map<String, Properties>> {
-               let resp = await 
vscode.commands.executeCommand(PropertiesView.COMMAND_GET_NODE_PROPERTIES, 
this.id);
-               if (!resp) {
+               const resp = await 
vscode.commands.executeCommand(PropertiesView.COMMAND_GET_NODE_PROPERTIES, 
this.id);
+               if (!isObject(resp)) {
                        // TODO - possibly report protocol error ?
                        return new Map<String, Properties>();
                }
diff --git a/java/java.lsp.server/vscode/src/typesUtil.ts 
b/java/java.lsp.server/vscode/src/typesUtil.ts
index 6c9d58f748..dc121791c7 100644
--- a/java/java.lsp.server/vscode/src/typesUtil.ts
+++ b/java/java.lsp.server/vscode/src/typesUtil.ts
@@ -34,7 +34,7 @@ export function isObject(obj: unknown): obj is object {
 }
 
 export function isRecord<K extends PropertyKey, T>(typeTest: IsType<T>, obj: 
unknown): obj is Record<K, T> {
-    return isObject(obj) && Object.keys(obj).every(typeTest);
+    return isObject(obj) && Object.values(obj).every(typeTest);
 }
 
 export function isError(obj: unknown): obj is Error {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to