MCPcopy Create free account
hub / github.com/microsoft/typescript-go / characterToColumn

Method characterToColumn

internal/format/span.go:883–895  ·  view source on GitHub ↗
(startLinePosition int, characterInLine int)

Source from the content-addressed store, hash-verified

881}
882
883func (w *formatSpanWorker) characterToColumn(startLinePosition int, characterInLine int) int {
884 column := 0
885 for i := range characterInLine {
886 if w.sourceFile.Text()[startLinePosition+i] == '\t' {
887 if w.formattingContext.Options.TabSize > 0 {
888 column += w.formattingContext.Options.TabSize - (column % w.formattingContext.Options.TabSize)
889 }
890 } else {
891 column++
892 }
893 }
894 return column
895}
896
897func (w *formatSpanWorker) indentationIsDifferent(indentationString string, startLinePosition int) bool {
898 text := w.sourceFile.Text()

Callers 1

insertIndentationMethod · 0.95

Calls 1

TextMethod · 0.65

Tested by

no test coverage detected