codefori / vscode-ibmi

🌍 IBM i development extension for VS Code
https://codefori.github.io/docs/#/
MIT License
288 stars 96 forks source link

List of member doesn't works (when attributes are blank) #743

Closed pabloto closed 2 years ago

pabloto commented 2 years ago

Hi,

this problem appear today after I update the extension to 1.4.0.

From object browser expanding a file source it doesn't appear nothing.

image

Obiously there are a lot of source, and in code for I output I see this:

codefori_output.txt

I try to delete the filter and recreate it, but nothing.

My library stay in an IASP.

Many thanks

pabloto commented 2 years ago

Downgrading to 1.3.10 it works.

worksofliam commented 2 years ago

@pabloto can you test and let me know if the IFS browser is also not working in 1.4.0?

I think I know the issue.

pabloto commented 2 years ago

Hi Liam,

Ifs seems works:

image

Obiously I'm again in 1.4.0

image

Let me know if I could help.

Many thanks

worksofliam commented 2 years ago

@pabloto

In 1.4.0:

  1. Toggle the developer tools (in photo)
  2. Try and load the source file list again
  3. Paste any error from dev tools console you see here
image
worksofliam commented 2 years ago

@pabloto Do you have time to meet and look at this together at all?

worksofliam commented 2 years ago

I see members with that weird character in it coming back.

edit: not the issue.

worksofliam commented 2 years ago

@pabloto 1.4.1 is coming out with some additional logging that will be printed to the dev tools console, so please follow the steps from that comment again when you have the new version.

pabloto commented 2 years ago

Hi hope to understand well your instructions:

[Extension Host] CPF2158: La libreria VSCODE esiste nell'unità ASP DIRECTA1. CPF2111: La libreria VSCODE esiste già. console.ts:137 [Extension Host] ls: cannot access '/QSYS.lib/VSCODE.lib/': Un file o una directory nel nome percorso non esiste. console.ts:137 [Extension Host] TypeError: Cannot read properties of null (reading 'replace') at e.exports.sysNameInLocal (/Users/osxtest/.vscode/extensions/halcyontechltd.code-for-ibmi-1.4.1/dist/extension.js:2:658921) at /Users/osxtest/.vscode/extensions/halcyontechltd.code-for-ibmi-1.4.1/dist/extension.js:2:665146 at Array.map () at e.exports.getMemberList (/Users/osxtest/.vscode/extensions/halcyontechltd.code-for-ibmi-1.4.1/dist/extension.js:2:665020) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async e.exports.getChildren (/Users/osxtest/.vscode/extensions/halcyontechltd.code-for-ibmi-1.4.1/dist/extension.js:2:718359) at async v.fetchChildrenNodes (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:106:19736) at async v.getChildren (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:106:15955)

worksofliam commented 2 years ago

Looks like we're not taking your ASP into account. I will see what I can do!

worksofliam commented 2 years ago

@pabloto Can you confirm:

  1. The name of your ASP is DIRECTA1
  2. You have SQL enabled or disabled
pabloto commented 2 years ago

Yes my iasp is directa1, and I have sql enable

worksofliam commented 2 years ago

@chrjorgensen I am gonna look into fixing this but note the error here:

TypeError: Cannot read properties of null (reading 'replace')
at e.exports.sysNameInLocal (/Users/osxtest/.vscode/extensions/halcyontechltd.code-for-ibmi-1.4.1/dist/extension.js:2:658921)
at /Users/osxtest/.vscode/extensions/halcyontechltd.code-for-ibmi-1.4.1/dist/extension.js:2:665146
at Array.map ()
at e.exports.getMemberList (/Users/osxtest/.vscode/extensions/halcyontechltd.code-for-ibmi-1.4.1/dist/extension.js:2:665020)
at processTicksAndRejections (node
worksofliam commented 2 years ago

Here's the issue.

Row coming back from the database:

MBASP: 33
MBFILE: 'QCLSRC'
MBMTXT: null
MBMXRL: 80
MBNAME: 'UCHKCONT1C'
MBSEU2: null

Code being executed:

        file: this.ibmi.sysNameInLocal(result.MBFILE),
        name: this.ibmi.sysNameInLocal(result.MBNAME),
        extension: this.ibmi.sysNameInLocal(result.MBSEU2),

So it's the null being passed in that's causing the error.

worksofliam commented 2 years ago

I am going to update sysNameInLocal and sysNameInAmerican so that if null is passed in, then it will return null right away.

chrjorgensen commented 2 years ago

Yeah, I see the error on my system as well - a source file member without type stops the generation of the member list. Hm, not a situation that I tested for, sorry... but great to have this fixed. 👍

worksofliam commented 2 years ago

@chrjorgensen it might be an hour or two before I get to making the PR. If you want to, feel free.

chrjorgensen commented 2 years ago

@worksofliam I see another solution - since the SQL method returns null where the DSPFD method returns blank, I think it would be better to change the SQL to make the same output as DSPFD:

coalesce( b.source_type, '' ) as MBSEU2,
coalesce( b.partition_text, '' ) as MBMTXT

This would make output from the two methods identical and ease later handling of the result.

What do you think?

worksofliam commented 2 years ago

@chrjorgensen That is likely a far better solution!

chrjorgensen commented 2 years ago

@worksofliam PR is coming...!

chrjorgensen commented 2 years ago

@worksofliam PR #745 has landed - please review.

The title of this issue mentions ASP not being taken into account - is there also a problem with ASP handling? I haven't changed any ASP handling...

worksofliam commented 2 years ago

@chrjorgensen Yes, let's ignore the title. I was wrong. I will fix that!

worksofliam commented 2 years ago

@pabloto 1.4.2 has the fix. Thanks!

pabloto commented 2 years ago

Thanks to you. Tomorrow I will try

pabloto commented 2 years ago

Hi @worksofliam , @chrjorgensen

it works perfect.

Many thanks