Come ottenere un vista struttura in editor di testo sublime?
-
21-09-2019 - |
Domanda
Come faccio ad avere una vista struttura in sublime editor di testo per Windows?
La minimappa è utile, ma mi manca un contorno tradizionale (un elenco klickable di tutte le funzioni nel mio codice nell'ordine in cui compaiono per la navigazione veloce e l'orientamento)
Forse c'è un plugin, addon o simili? Sarebbe anche bello se è possibile a breve nome che passi sono neccesary per farlo funzionare.
C'è un duplicato di questa domanda sui forum di testo sublimi.
Soluzione
Hit CTRL + R o CMD + R per Mac, per l'elenco delle funzioni. Questo funziona in Sublime Text 1.3 o superiore.
Altri suggerimenti
Io uso la piega tutte le azioni. Sarà ridurre tutto alla dichiarazione, posso vedere tutti i metodi / funzioni, e quindi espandere quello che mi interessa.
Un plugin di nome Struttura è disponibile in controllo del pacchetto, provare per credere! https://packagecontrol.io/packages/Outline
Nota: non funziona in modalità multi righe / colonne. Per più righe / colonne funzionano utilizzare questa forcella: https://github.com/vlad-wonderkidstudio/SublimeOutline
ho brevemente guardo SublimeText 3 api e view.find_by_selector(selector)
sembra essere in grado per restituire un elenco delle regioni.
Quindi credo che un plugin che visualizzerebbe il contorno / struttura del file è possibile.
Un plugin che cosa di questo tipo:
Nota: le href="https://github.com/akrabat/SublimeFunctionNameDisplay" plugin di visualizzazione del nome funzione potrebbe essere utilizzato come un ispirazione per estrarre i nomi delle classi / metodi o ClassHierarchy per estrarre la struttura di massima
Se si vuole essere in grado per stampare o salvare il contorno il comando / + R CTR non è molto utile.
Si può fare un semplice trovare tutte sul seguente grep ^[^\n]*function[^{]+{
o qualche variante di esso per soddisfare la lingua e la situazione si sta lavorando in.
Una volta fatto il trovate tutto è possibile copiare e incollare il risultato in un nuovo documento e in funzione del numero di funzioni non dovrebbe prendere tempo per riordinare.
La risposta è ben lungi dall'essere perfetto, in particolare nei casi in cui i commenti che hanno la funzione di parola (o il suo equivalente) in loro, ma io non penso che sia una risposta utile.
Con una modifica molto veloce questo è il risultato ho ottenuto su quello su cui sto lavorando ora.
PathMaker.prototype.start = PathMaker.prototype.initiate = function(point){};
PathMaker.prototype.path = function(thePath){};
PathMaker.prototype.add = function(point){};
PathMaker.prototype.addPath = function(path){};
PathMaker.prototype.go = function(distance, angle){};
PathMaker.prototype.goE = function(distance, angle){};
PathMaker.prototype.turn = function(angle, distance){};
PathMaker.prototype.continue = function(distance, a){};
PathMaker.prototype.curve = function(angle, radiusX, radiusY){};
PathMaker.prototype.up = PathMaker.prototype.north = function(distance){};
PathMaker.prototype.down = PathMaker.prototype.south = function(distance){};
PathMaker.prototype.east = function(distance){};
PathMaker.prototype.west = function(distance){};
PathMaker.prototype.getAngle = function(point){};
PathMaker.prototype.toBezierPoints = function(PathMakerPoints, toSource){};
PathMaker.prototype.extremities = function(points){};
PathMaker.prototype.bounds = function(path){};
PathMaker.prototype.tangent = function(t, points){};
PathMaker.prototype.roundErrors = function(n, acurracy){};
PathMaker.prototype.bezierTangent = function(path, t){};
PathMaker.prototype.splitBezier = function(points, t){};
PathMaker.prototype.arc = function(start, end){};
PathMaker.prototype.getKappa = function(angle, start){};
PathMaker.prototype.circle = function(radius, start, end, x, y, reverse){};
PathMaker.prototype.ellipse = function(radiusX, radiusY, start, end, x, y , reverse/*, anchorPoint, reverse*/ ){};
PathMaker.prototype.rotateArc = function(path /*array*/ , angle){};
PathMaker.prototype.rotatePoint = function(point, origin, r){};
PathMaker.prototype.roundErrors = function(n, acurracy){};
PathMaker.prototype.rotate = function(path /*object or array*/ , R){};
PathMaker.prototype.moveTo = function(path /*object or array*/ , x, y){};
PathMaker.prototype.scale = function(path, x, y /* number X scale i.e. 1.2 for 120% */ ){};
PathMaker.prototype.reverse = function(path){};
PathMaker.prototype.pathItemPath = function(pathItem, toSource){};
PathMaker.prototype.merge = function(path){};
PathMaker.prototype.draw = function(item, properties){};