monaco-editor icon indicating copy to clipboard operation
monaco-editor copied to clipboard

HI everyone!! I have a Q. How to hide some area of code??

Open Kang-Jun-sik opened this issue 8 years ago • 3 comments

HI everyone!! I have a Question about monaco-editor.

main Q : How to hide some code of the monaco-editor??

for Example)

var userInfo = self.user;
var def_cdPcDataSource = []; def_cdPcDataSource.push({CD_PC : userInfo.profitCenterCode,NM_PC : userInfo.profitCenterName});

I wrote above 3 line in monacoEditor! but I don't want to show 3 lines to user... Could you let me know ....?

Kang-Jun-sik avatar Dec 12 '17 06:12 Kang-Jun-sik

@Kang-Jun-sik I found that there is an internal method (non API way and might get removed in the future) that can be applied to editor:

setHiddenAreas(ranges: IRange[]): void;

nekitozzz avatar Dec 12 '17 15:12 nekitozzz

q1 q2 q3 q4

Thank you very much for your apply!! But I have a another problem. when I use delete all of the content in monaco Editor, I can see that error and editor can't execute anymore.. how can i solve it...

Kang-Jun-sik avatar Dec 13 '17 04:12 Kang-Jun-sik

I solve it!!! you have to write the code .setEditableChange(Range) Thank you very much!!

Kang-Jun-sik avatar Dec 14 '17 05:12 Kang-Jun-sik