Skip to content

Commit

Permalink
chore!: remote symbols support
Browse files Browse the repository at this point in the history
  • Loading branch information
libondev committed Nov 25, 2024
1 parent d922ffa commit 86892a3
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 57 deletions.
3 changes: 0 additions & 3 deletions README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,6 @@ This document is also available in [English](./README-CN.md).
// 是否插入行号
"debugger-for-console.lineNumber": true,

// 是否插入当前上下文栈
"debugger-for-console.symbols": false,

// 把变量和提示符放在不同行输出 (如果内容很长时看起来会更方便)
"debugger-for-console.outputNewline": false,

Expand Down
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,6 @@ You can personalize the statements you wish to insert via the Settings. (This pl
// Whether or not whether to insert the line number
"debugger-for-console.lineNumber": true,

// Insert scope symbols in the debug statement
"debugger-for-console.symbols": false,

// Show variables and logos in rows. (Very effective when the content is long.)
"debugger-for-console.outputNewline": false,

Expand Down
5 changes: 0 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,6 @@
"default": true,
"description": "Determine whether to insert the line number."
},
"debugger-for-console.symbols": {
"type": "boolean",
"default": false,
"description": "Insert scope symbols in the debug statement. \nTips: Enabling this option can make your debug statements very very very loooooong,\nbecause it represents your code call level."
},
"debugger-for-console.outputNewline": {
"type": "boolean",
"default": false,
Expand Down
8 changes: 3 additions & 5 deletions src/commands/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { getEmoji } from '../features/emoji'
import { getLines } from '../features/lines'
import { getLevel } from '../features/level'
import { getScope } from '../features/scope'
import { getSymbols } from '../features/symbols'
import { getOnlyVariable, getOutputNewline } from '../features/variable'
import { getAfterEmptyLine, getBeforeEmptyLine } from '../features/empty-line'

Expand Down Expand Up @@ -54,7 +53,7 @@ function getInsertLineIndents(
return indentsChar.repeat(insertLineIndents)
}

function getStatementGenerator(document: TextDocument, symbols: string) {
function getStatementGenerator(document: TextDocument) {
const statement = getLanguageStatement(document)

if (!statement) {
Expand All @@ -69,7 +68,7 @@ function getStatementGenerator(document: TextDocument, symbols: string) {
const quote = getQuote(document.languageId)

const template = `${start}${quote}${getEmoji()}${
getLevel(document)}$1${symbols}/[$2]:${getOutputNewline()}${quote}$3${end.join('')}\n`
getLevel(document)}$1/[$2]:${getOutputNewline()}${quote}$3${end.join('')}\n`

return (lineNumber: number, text: string) => template
.replace('$1', getLines(lineNumber) as string)
Expand Down Expand Up @@ -112,8 +111,7 @@ async function create(insertOffset: number, displayOffset: number) {
return
}

const scopeSymbols = await getSymbols(editor)
const statementGetter = getStatementGenerator(document, scopeSymbols)
const statementGetter = getStatementGenerator(document)
let position = new Position(0, 0)

const insertPosition = insertOffset > 0 ? 'after' : 'before'
Expand Down
41 changes: 0 additions & 41 deletions src/features/symbols.ts

This file was deleted.

0 comments on commit 86892a3

Please sign in to comment.