Skip to content

Commit

Permalink
Elaborate on settings descriptions and make settings names consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
firai committed Oct 16, 2023
1 parent c3fb0ae commit 04cb650
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ import {

import { indentationMarkers } from '@replit/codemirror-indentation-markers';

interface IGuideTypeDict {
interface IGuideExtentMapDict {
[index: string]: 'fullScope' | 'codeOnly';
}
const guideTypeMap = {
const guideExtentMap = {
'Full scope': 'fullScope' as const,
'Code only': 'codeOnly' as const
} as IGuideTypeDict;
} as IGuideExtentMapDict;

/**
* Initialization data for the jupyterlab-indent-guides extension.
Expand All @@ -33,7 +33,7 @@ const plugin: JupyterFrontEndPlugin<void> = {
default: {
highlightActiveBlock: true,
hideFirstIndent: false,
guideType: 'Full scope',
guideExtent: 'Full scope',
thickness: 1,
colors: {
light: '#bdbdbd',
Expand All @@ -47,7 +47,7 @@ const plugin: JupyterFrontEndPlugin<void> = {
(indentGuideOptions: {
highlightActiveBlock: boolean;
hideFirstIndent: boolean;
guideType: string;
guideExtent: string;
thickness: number;
colors: {
light: string;
Expand All @@ -59,7 +59,7 @@ const plugin: JupyterFrontEndPlugin<void> = {
indentationMarkers({
highlightActiveBlock: indentGuideOptions.highlightActiveBlock,
hideFirstIndent: indentGuideOptions.hideFirstIndent,
markerType: guideTypeMap[indentGuideOptions.guideType],
markerType: guideExtentMap[indentGuideOptions.guideExtent],
thickness: indentGuideOptions.thickness,
colors: {
light: indentGuideOptions.colors.light,
Expand All @@ -75,15 +75,19 @@ const plugin: JupyterFrontEndPlugin<void> = {
properties: {
highlightActiveBlock: {
type: 'boolean',
title: 'Highlight active block'
title: 'Highlight active block',
description:
'Use a different color for guide in the active block. Change the active block guide colors below. Disabling provides a performance enhancement, because guides do not need to be regenerated when the selection changes.'
},
hideFirstIndent: {
type: 'boolean',
title: 'Hide guide for first indentation level'
title: 'Hide guide at the first column'
},
guideType: {
title: 'Guide type',
enum: ['Full scope', 'Code only']
guideExtent: {
title: 'Guide extent',
enum: ['Full scope', 'Code only'],
description:
'How far the indentation guides extend. "Full scope" means guides extend down the full height of a scope. "Code only" means guides terminate at the last nonempty line in a scope.'
},
thickness: {
type: 'number',
Expand Down

0 comments on commit 04cb650

Please sign in to comment.