forked from ant-druha/intellij-powershell
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Variables cache see PowerShell/PowerShellEditorServices#2169 Debugger WIP 15 Catch value modification errors Debugger WIP 15 Debugger eval completion Debugger WIP 14 Add id to document Debugger WIP 13 Remove useless files Debugger WIP 12 Add Variable Test Debugger WIP 11.2 Remove useless comments Debugger WIP 11.1 Change hardcoded parameter to variable remove unused variable from EvaluationTest.testEvaluation Debugger WIP 11 Call clientSession.terminateDebugging() on dispose Change PowerShellDebuggerVariableValue supertype to XNamedValue update formatting Test: Update BreakpointTest Add EvaluationTest Add StepTest Debugger WIP 10 Add tests Add BreakpointTest Debugger WIP 9 Set variable value Debugger WIP 8 run project file instead hardcoded file set all breakpoints on start Debugger WIP 7 Step Over/In/Out support Terminate support Debugger WIP 6 Conditional and log support Debugger WIP 5 IDE Breakpoints support Resume (continue) support Debugger WIP 5 Variable list Complex objects Debugger WIP 3 variable list eval Debugger WIP 2 Debugger WIP
- Loading branch information
Showing
26 changed files
with
1,592 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
48 changes: 0 additions & 48 deletions
48
src/main/kotlin/com/intellij/plugin/powershell/ide/actions/PowerShellStartDebugAction.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
93 changes: 87 additions & 6 deletions
93
src/main/kotlin/com/intellij/plugin/powershell/ide/debugger/PowerShellBreakpointType.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,109 @@ | ||
package com.intellij.plugin.powershell.ide.debugger | ||
|
||
import com.intellij.ide.highlighter.XmlFileType | ||
import com.intellij.idea.ActionsBundle | ||
import com.intellij.openapi.actionSystem.AnAction | ||
import com.intellij.openapi.actionSystem.AnActionEvent | ||
import com.intellij.openapi.fileEditor.FileDocumentManager | ||
import com.intellij.openapi.project.Project | ||
import com.intellij.openapi.vfs.VirtualFile | ||
import com.intellij.plugin.powershell.PowerShellFileType | ||
import com.intellij.plugin.powershell.ide.MessagesBundle | ||
import com.intellij.psi.PsiDocumentManager | ||
import com.intellij.ui.components.AnActionLink | ||
import com.intellij.ui.components.JBTextField | ||
import com.intellij.ui.components.Label | ||
import com.intellij.util.ui.JBUI | ||
import com.intellij.xdebugger.XDebuggerManager | ||
import com.intellij.xdebugger.breakpoints.XBreakpointProperties | ||
import com.intellij.xdebugger.breakpoints.XLineBreakpoint | ||
import com.intellij.xdebugger.breakpoints.XLineBreakpointType | ||
import com.intellij.xdebugger.breakpoints.ui.XBreakpointCustomPropertiesPanel | ||
import com.intellij.xdebugger.evaluation.XDebuggerEditorsProvider | ||
import com.intellij.xdebugger.impl.breakpoints.XBreakpointBase | ||
import java.awt.BorderLayout | ||
import java.awt.Component | ||
import java.awt.Dimension | ||
import javax.swing.* | ||
|
||
//XsltDebuggerBundle.message("title.xslt.breakpoints") | ||
class PowerShellBreakpointType : XLineBreakpointType<XBreakpointProperties<*>>("powershell", MessagesBundle.message("powershell.debugger.breakpoints.title")) { | ||
override fun canPutAt(file: VirtualFile, line: Int, project: Project): Boolean { | ||
val document = FileDocumentManager.getInstance().getDocument(file) ?: return false | ||
|
||
val psiFile = PsiDocumentManager.getInstance(project).getPsiFile(document) ?: return false | ||
val fileType = psiFile.fileType | ||
if (fileType != PowerShellFileType.INSTANCE) { | ||
return false | ||
} | ||
return true | ||
return fileType is PowerShellFileType | ||
} | ||
|
||
override fun createBreakpointProperties(file: VirtualFile, line: Int): XBreakpointProperties<*>? { | ||
return null | ||
} | ||
|
||
override fun getEditorsProvider( | ||
breakpoint: XLineBreakpoint<XBreakpointProperties<*>>, | ||
project: Project | ||
): XDebuggerEditorsProvider { | ||
return PowerShellDebuggerEditorsProvider(XDebuggerManager.getInstance(project).currentSession, "BPTYPE") | ||
} | ||
|
||
|
||
/*override fun createCustomConditionsPanel(): XBreakpointCustomPropertiesPanel<XLineBreakpoint<XBreakpointProperties<*>>> { | ||
return CollectionBreakpointPropertiesPanel() | ||
}*/ | ||
} | ||
|
||
class CollectionBreakpointPropertiesPanel : XBreakpointCustomPropertiesPanel<XLineBreakpoint<XBreakpointProperties<*>>>() { | ||
private var myClsName: String? = null | ||
private var myFieldName: String? = "Condition:" | ||
private var mySaveCollectionHistoryCheckBox: JCheckBox? = null | ||
|
||
override fun getComponent(): JComponent { | ||
|
||
val box = Box.createVerticalBox() | ||
|
||
var panel: JPanel = JBUI.Panels.simplePanel() | ||
//panel.add(JTextField()) | ||
val textField = JBTextField() | ||
val label = Label("Condition:").apply { | ||
labelFor = textField | ||
alignmentX = Component.LEFT_ALIGNMENT | ||
} | ||
box.add(label) | ||
box.add(textField) | ||
panel.add(box) | ||
|
||
return panel | ||
} | ||
|
||
override fun saveTo(breakpoint: XLineBreakpoint<XBreakpointProperties<*>>) { | ||
/* val changed = | ||
breakpoint.getProperties().SHOULD_SAVE_COLLECTION_HISTORY !== mySaveCollectionHistoryCheckBox!!.isSelected | ||
breakpoint.getProperties().SHOULD_SAVE_COLLECTION_HISTORY = mySaveCollectionHistoryCheckBox!!.isSelected*/ | ||
/*if (true) { | ||
(breakpoint as XBreakpointBase<*, *, *>).fireBreakpointChanged() | ||
}*/ | ||
} | ||
|
||
override fun loadFrom(breakpoint: XLineBreakpoint<XBreakpointProperties<*>>) { | ||
/*val properties = breakpoint.getProperties() | ||
myClsName = properties.myClassName | ||
myFieldName = properties.myFieldName | ||
mySaveCollectionHistoryCheckBox!!.isSelected = properties.SHOULD_SAVE_COLLECTION_HISTORY*/ | ||
} | ||
|
||
private inner class MyShowCollectionHistoryAction : AnAction() { | ||
override fun actionPerformed(e: AnActionEvent) { | ||
val clsName = myClsName | ||
val fieldName = myFieldName | ||
if (clsName == null || fieldName == null) { | ||
return | ||
} | ||
val project = getEventProject(e) ?: return | ||
val session = XDebuggerManager.getInstance(project).currentSession ?: return | ||
//DebuggerUtilsEx.addCollectionHistoryTab(session, clsName, fieldName, null) | ||
} | ||
} | ||
|
||
companion object { | ||
private const val PREFERRED_PANEL_HEIGHT = 40 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.