text stringlengths 14 100k | source stringclasses 1
value | repo stringclasses 810
values | language stringclasses 13
values |
|---|---|---|---|
<|fim_suffix|>ad(
"flushing spans",
&["experimental-lang"],
format!("flushing spans: {:?}", self.spans),
);
view.update_spans(self.spans_start, self.offset - self.spans_start, &self.spans);
self.spans.clear();
}
self.sp... | fim | xi-editor/xi-editor | rust |
<|fim_prefix|>// Copyright 2018 The xi-editor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the Lic<|fim_suffix|>ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitati... | fim | xi-editor/xi-editor | rust |
<|fim_suffix|>low(dead_code)] // not used by rust lang, but used in tests
pub struct OneOrMore<P>(pub P);
impl<P: Peg> Peg for OneOrMore<P> {
#[inline]
fn p(&self, s: &[u8]) -> Option<usize> {
Repeat(Ref(&self.0), 1..).p(s)
}
}
pub struct ZeroOrMore<P>(pub P);
impl<P: Peg> Peg for ZeroOrMore<P> {... | fim | xi-editor/xi-editor | rust |
<|fim_prefix|>// Copyright 2017 The xi-editor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applic... | fim | xi-editor/xi-editor | rust |
<|fim_prefix|>// Copyright 2018 The xi-editor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applic... | fim | xi-editor/xi-editor | rust |
<|fim_prefix|>// Copyright 2018 The xi-editor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applic... | fim | xi-editor/xi-editor | rust |
<|fim_prefix|>// Copyright 2018 The xi-editor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applic... | fim | xi-editor/xi-editor | rust |
<|fim_prefix|>// Copyright 2018 The xi-editor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applic... | fim | xi-editor/xi-editor | rust |
<|fim_prefix|>// Copyright 2018 The xi-editor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applic... | fim | xi-editor/xi-editor | rust |
<|fim_prefix|>// Copyright 2018 The xi-editor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www<|fim_suffix|>ength(split[1].parse()?)),
_ => Err(ParseE... | fim | xi-editor/xi-editor | rust |
// Copyright 2018 The xi-editor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or ag... | fim | xi-editor/xi-editor | rust |
<|fim_prefix|>// Copyright 2018 The xi-editor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applic... | fim | xi-editor/xi-editor | rust |
<|fim_prefix|>// Copyright 2018 The xi-editor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applic... | fim | xi-editor/xi-editor | rust |
<|fim_prefix|>// Copyright 2018 The xi-editor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applic... | fim | xi-editor/xi-editor | rust |
<|fim_suffix|>wId,
request_id: usize,
result: &Result<Hover, RemoteError>,
) {
let params = json!({
"plugin_id": self.plugin_id,
"request_id": request_id,
"result": result,
"view_id": view_id
});
self.peer.send_rpc_notification... | fim | xi-editor/xi-editor | rust |
<|fim_suffix|> None => {
warn!("{:?} missing {:?} for {:?}", $pid, $view, $method);
return Err(RemoteError::custom(404, "missing view", None));
}
}
};
}
/// Handles raw RPCs from core, updating state and forwarding calls
/// to the plugin,
pub struct Dispatche... | fim | xi-editor/xi-editor | rust |
<|fim_suffix|>ache>, old_path: Option<&Path>);
/// Called when a view has been closed. By the time this message is received,
/// It is possible to send messages to this view. The plugin may wish to
/// perform cleanup, however.
fn did_close(&mut self, view: &View<Self::Cache>);
/// Called when there... | fim | xi-editor/xi-editor | rust |
<|fim_prefix|>// Copyright 2016 The xi-editor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applic... | fim | xi-editor/xi-editor | rust |
<|fim_prefix|>// Copyright 2018 The xi-editor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applic... | fim | xi-editor/xi-editor | rust |
<|fim_suffix|>for _ in 0..n {
s += &line;
s += "\n";
line += "a";
}
s
}
fn build_short_lines(n: usize) -> String {
let line = "match s.as_bytes()[minsplit - 1..splitpoint].iter().rposition(|&c| c == b'\n') {";
let mut s = String::new();
for _ in 0..n {
s += line;
... | fim | xi-editor/xi-editor | rust |
<|fim_prefix|>// Copyright 2018 The xi-editor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applic... | fim | xi-editor/xi-editor | rust |
<|fim_suffix|>ertion = build_triangle(3000);
let insertion_len = insertion.len();
let mut offset = 0;
b.iter(|| {
text.edit(offset..=offset, &insertion);
offset += insertion_len;
});
}
#[bench]
fn real_world_editing_scenario(b: &mut Bencher) {
b.iter(|| {
let mut text = Rope... | fim | xi-editor/xi-editor | rust |
<|fim_suffix|>et l = a.len();
for s in a.clone().iter_chunks(1000..3000) {
println!("chunk {:?}", s);
}
a.edit(1000..l, "");
//a = a.subrange(0, 1000);
println!("{:?}", String::from(a));
}
<|fim_prefix|>// Copyright 2016 The xi-editor Authors.
//
// Licensed under the Apache License, Version... | fim | xi-editor/xi-editor | rust |
<|fim_suffix|> }
}
#[cfg(test)]
mod tests {
use crate::breaks::{BreakBuilder, BreaksInfo, BreaksLeaf, BreaksMetric};
use crate::interval::Interval;
use crate::tree::{Cursor, Node};
fn gen(n: usize) -> Node<BreaksInfo> {
let mut node = Node::default();
let mut b = BreakBuilder::new();
... | fim | xi-editor/xi-editor | rust |
<|fim_prefix|>// Copyright 2018 The xi-editor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applic... | fim | xi-editor/xi-editor | rust |
<|fim_prefix|>// Copyright 2016 The xi-editor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applic... | fim | xi-editor/xi-editor | rust |
// Copyright 2018 The xi-editor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or ag... | fim | xi-editor/xi-editor | rust |
<|fim_suffix|> gc_dels = gc_dels.transform_expand(inserts);
}
if !deletes.is_empty() {
gc_dels = gc_dels.union(deletes);
}
}
} else... | fim | xi-editor/xi-editor | rust |
<|fim_prefix|>// Copyright 2017 The xi-editor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applic... | fim | xi-editor/xi-editor | rust |
<|fim_prefix|>// Copyright 2016 The xi-editor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applic... | fim | xi-editor/xi-editor | rust |
<|fim_suffix|>elta::{Builder as DeltaBuilder, Delta, DeltaElement, Transformer};
pub use crate::interval::Interval;
pub use crate::rope::{LinesMetric, Rope, RopeDelta, RopeInfo};
pub use crate::tree::{Cursor, Metric};
<|fim_prefix|>// Copyright 2016 The xi-editor Authors.
//
// Licensed under the Apache License, Versio... | fim | xi-editor/xi-editor | rust |
// Copyright 2017 The xi-editor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or ag... | fim | xi-editor/xi-editor | rust |
<|fim_prefix|>// Copyright 2016 The xi-editor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applic... | fim | xi-editor/xi-editor | rust |
// Copyright 2019 The xi-editor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or ag... | fim | xi-editor/xi-editor | rust |
<|fim_prefix|>// Copyright 2016 The xi-editor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applic... | fim | xi-editor/xi-editor | rust |
<|fim_prefix|>// Copyright 2016 The xi-editor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applic... | fim | xi-editor/xi-editor | rust |
<|fim_suffix|> return Node::merge_leaves(rope1, rope2);
}
Node::merge_nodes(rope1.get_children(), rope2.get_children())
}
Ordering::Greater => {
let children1 = rope1.get_children();
if h2 == h1 - 1 && rope2.is_ok... | fim | xi-editor/xi-editor | rust |
// Copyright 2016 The xi-editor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or ag... | fim | xi-editor/xi-editor | rust |
<|fim_prefix|>// Copyright 2017 The xi-editor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applic... | fim | xi-editor/xi-editor | rust |
<|fim_prefix|>// Copyright 2016 The xi-editor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applic... | fim | xi-editor/xi-editor | rust |
<|fim_prefix|>// Copyright 2017 The xi-editor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applic... | fim | xi-editor/xi-editor | rust |
<|fim_prefix|>// Copyright 2017 The xi-editor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applic... | fim | xi-editor/xi-editor | rust |
<|fim_suffix|>test]
fn test_recv_resp() {
// we should reply to a well formed request
let mut handler = EchoHandler;
let (tx, mut rx) = test_channel();
let mut rpc_looper = RpcLoop::new(tx);
let r = make_reader(r#"{"id": 1, "method": "hullo", "params": {"words": "plz"}}"#);
assert!(rpc_looper.ma... | fim | xi-editor/xi-editor | rust |
<|fim_suffix|>ntended as an illustration and a template for plugin
//! developers.
extern crate xi_core_lib as xi_core;
extern crate xi_plugin_lib;
extern crate xi_rope;
use std::path::Path;
use crate::xi_core::ConfigTable;
use xi_plugin_lib::{mainloop, ChunkCache, Error, Plugin, View};
use xi_rope::delta::Builder as... | fim | xi-editor/xi-editor | rust |
<|fim_prefix|>// Copyright 2016 The xi-editor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applic... | fim | xi-editor/xi-editor | rust |
<|fim_prefix|>// Copyright 2018 The xi-editor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applic... | fim | xi-editor/xi-editor | rust |
<|fim_suffix|>ntect"]);
let view_id = view.get_id();
let state = PluginState::new();
self.view_state.insert(view_id, state);
self.do_highlighting(view);
}
fn did_close(&mut self, view: &View<Self::Cache>) {
self.view_state.remove(&view.get_id());
}
fn did_save(&... | fim | xi-editor/xi-editor | rust |
<|fim_prefix|>// Copyright 2017 The xi-editor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applic... | fim | xi-editor/xi-editor | rust |
<|fim_suffix|> = Vec::<u8>::new();
let samples = vec![
Sample::new_instant("trace1", &["benchmark", "test"], None),
Sample::new_instant("trace2", &["benchmark"], None),
Sample::new_duration("trace3", &["benchmark"], Some(to_payload("some payload")), 0, 0),
Sample:... | fim | xi-editor/xi-editor | rust |
<|fim_prefix|>// Copyright 2018 The xi-editor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applic... | fim | xi-editor/xi-editor | rust |
<|fim_prefix|>// Copyright 2018 The xi-editor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applic... | fim | xi-editor/xi-editor | rust |
<|fim_prefix|>// Copyright 2018 The xi-editor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applic... | fim | xi-editor/xi-editor | rust |
// Copyright 2018 The xi-editor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or ag... | fim | xi-editor/xi-editor | rust |
// Copyright 2016 The xi-editor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or ag... | fim | xi-editor/xi-editor | rust |
<|fim_suffix|> {
let _ = run_test(&filename, true);
}
_ => {
println!("unknown argument");
}
}
}
<|fim_prefix|>// Copyright 2016 The xi-editor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in complia... | fim | xi-editor/xi-editor | rust |
<|fim_suffix|>61D}', '\u{26F9}', '\u{270A}', '\u{270B}',
'\u{270C}', '\u{270D}', '\u{1F385}', '\u{1F3C2}', '\u{1F3C3}', '\u{1F3C4}', '\u{1F3C7}', '\u{1F3CA}',
'\u{1F3CB}', '\u{1F3CC}', '\u{1F442}', '\u{1F443}', '\u{1F446}', '\u{1F447}', '\u{1F448}', '\u{1F449}',
'\u{1F44A}', '\u{1F44B}', '\u{1F44C}', '\u{1F44D}', '\u{1... | fim | xi-editor/xi-editor | rust |
<|fim_prefix|>// Copyright 2016 The xi-editor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applic... | fim | xi-editor/xi-editor | rust |
<|fim_suffix|>("Unicode Breaks: {:?}", fail.1);
println!("Xi Breaks: {:?}\n", fail.2);
}
panic!("failed line break test.");
}
}
// A typical test looks like: "× 0023 × 0308 × 0020 ÷ 0023 ÷"
fn parse_test(test: &str) -> (String, Vec<usize>) {
use std::char;
let mut parts =... | fim | xi-editor/xi-editor | rust |
<|fim_prefix|>// Copyright 2016 The xi-editor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applic... | fim | xi-editor/xi-editor | cpp |
<|fim_prefix|>#!/usr/bin/env python
# Copyright 2016 The xi-editor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | fim | xi-editor/xi-editor | python |
<|fim_suffix|>atic void main(String[] args) {
SpringApplication.run(SpringBootDemoActivitiApplication.class, args);
}
}
<|fim_prefix|>package com.xkcoding.activiti;
import org.springframework.boot.SpringApplication;
import org.springframew<|fim_middle|>ork.boot.autoconfigure.SpringBootApplication;
/**
... | fim | xkcoding/spring-boot-demo | java |
<|fim_suffix|>lsManager;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* <p>
* 安全配置类
* </p>
*
* @author yangkai.shen
* @date Created in 2019-07-01 18:40
*/
@Slf4j
@Configuration
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
@Override
... | fim | xkcoding/spring-boot-demo | java |
<|fim_suffix|> }
@Override
public Object getDetails() {
return user;
}
@Override
public Object getPrincipal() {
return user;
}
@Override
public boolean isAuthenticated() {
r... | fim | xkcoding/spring-boot-demo | java |
<|fim_prefix|>package com.xkcoding.activiti;
import com.xkcoding.activiti.util.SecurityUtil;
import org.activiti.api.process.model.ProcessDefinition;
import org.activiti.api.process.runtime.ProcessRuntime;
import org.activiti.api.runtime.shared.query.Page;
import org.activiti.a<|fim_suffix|> Page<ProcessDefinition> p... | fim | xkcoding/spring-boot-demo | java |
<|fim_suffix|>Application;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* <p>
* 启动类
* </p>
*
* @author yangkai.shen
* @date Created in 2018-9-29 14:27
*/
@SpringBootApplication
public class SpringBootDemoActuatorApplication {
public static void main(String[] args) {
Spri... | fim | xkcoding/spring-boot-demo | java |
<|fim_suffix|>ionTests {
@Test
public void contextLoads() {
}
}
<|fim_prefix|>package com.xkcoding.actuator;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.<|fim_middle|>springframework.test.context.junit4.SpringRunner;
@Ru... | fim | xkcoding/spring-boot-demo | java |
<|fim_prefix|>package com.xkcoding.admin.client;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.<|fim_suffix|>on.class, args);
}
}
<|fim_middle|>SpringBootApplication;
/**
* <p>
* 启动类
* </p>
*
* @author yangkai.shen
* @date Created in 2018-10-8 14:16
*/
@Sp... | fim | xkcoding/spring-boot-demo | java |
<|fim_suffix|>", "/"})
public String index() {
return "This is a Spring Boot Admin Client.";
}
}
<|fim_prefix|>package com.xkcoding.admin.client.controller;
import org.springframework.we<|fim_middle|>b.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p... | fim | xkcoding/spring-boot-demo | java |
<|fim_prefix|>package com.xkcoding.admin.client;
impo<|fim_suffix|>ootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class SpringBootDemoAdminClientApplicationTests {
@Test
public void contextLoads() {
}
}
<|fim_middle|>rt org.junit... | fim | xkcoding/spring-boot-demo | java |
<|fim_prefix|>package com.xkcoding.admin.server;
import de.codecentric.boot.ad<|fim_suffix|>ringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* <p>
* 启动类
* </p>
*
* @author yangkai.shen
* @date Created in 2018-10-08 14:08
*/
@EnableAdminServer
@SpringBootApplication
publ... | fim | xkcoding/spring-boot-demo | java |
<|fim_suffix|>lic void contextLoads() {
}
}
<|fim_prefix|>package com.xkcoding.admin.server;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.spring<|fim_middle|>framework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)... | fim | xkcoding/spring-boot-demo | java |
package com.xkcoding.async;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableAsync;
/**
* <p>
* 启动器
* </p>
*
* @author yangkai.shen
* @date Created in 2018-12-29 10:28
*/
@EnableAsync
@... | fim | xkcoding/spring-boot-demo | java |
<|fim_prefix|>package com.xkcoding.async.task;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.AsyncResult;
import org.springframework.stereotype.Component;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUn... | fim | xkcoding/spring-boot-demo | java |
<|fim_prefix|>packa<|fim_suffix|>org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class SpringBootDemoAsyncApplicationTests {
@Test
public void contextLoads() {
}
}
<|fim_middle|>ge com.xkcoding.async;
import org.junit.Test;
import org.junit.runn... | fim | xkcoding/spring-boot-demo | java |
<|fim_prefix|>package com.xkcoding.async.task;
import com.xkcoding.async.SpringBootDemoAsyncApplicationTests;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
/**... | fim | xkcoding/spring-boot-demo | java |
<|fim_suffix|>toconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
/**
* <p>
* 启动类
* </p>
*
* @author yangkai.shen
* @date Created in 2018-11-16 17:02
*/
@SpringBootApplication
@EnableCaching
public class SpringBootDemoCacheEhcacheApplication {
public static void ma... | fim | xkcoding/spring-boot-demo | java |
<|fim_suffix|> yangkai.shen
* @date Created in 2018-11-16 16:53
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class User implements Serializable {
private static final long serialVersionUID = 2892248514883451461L;
/**
* 主键id
*/
private Long id;
/**
* 姓名
*/
private Stri... | fim | xkcoding/spring-boot-demo | java |
<|fim_prefix|>package com.xkcoding.cache.ehcache.service;
import com.xkcoding.cache.ehcache.entity.User;
/**
* <p>
* UserService
* </p>
*
* @author yangkai.shen
* @date Created in 2018-11-16 16:53
*/
public interface UserService {
/**<|fim_suffix|> * @return 操作结果
*/
User saveOrUpdate(User user);... | fim | xkcoding/spring-boot-demo | java |
package com.xkcoding.cache.ehcache.service.impl;
import com.google.common.collect.Maps;
import com.xkcoding.cache.ehcache.entity.User;
import com.xkcoding.cache.ehcache.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annota... | fim | xkcoding/spring-boot-demo | java |
<|fim_suffix|>nTests {
@Test
public void contextLoads() {
}
}
<|fim_prefix|>package com.xkcoding.cache.ehcache;
import org.junit.Test;
import org.junit<|fim_middle|>.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
... | fim | xkcoding/spring-boot-demo | java |
<|fim_suffix|>
/**
* 测试删除,查看redis是否存在缓存数据
*/
@Test
public void deleteUser() {
// 查询一次,使ehcache中存在缓存数据
userService.get(1L);
// 删除,查看ehcache是否存在缓存数据
userService.delete(1L);
}
}
<|fim_prefix|>package com.xkcoding.cache.ehcache.service;
import com.xkcoding.cache.eh... | fim | xkcoding/spring-boot-demo | java |
<|fim_prefix|>package com.xkcoding.cache.redis;
import org.springframework.boot.SpringApplication;
import org.sprin<|fim_suffix|>ication {
public static void main(String[] args) {
SpringApplication.run(SpringBootDemoCacheRedisApplication.class, args);
}
}
<|fim_middle|>gframework.boot.autoconfigure.Sp... | fim | xkcoding/spring-boot-demo | java |
<|fim_prefix|>package com.xkcoding.cache.redis.config;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
import org.springframework.cache.CacheManager;
import org.springframework.cache.annotation.EnableCaching;
import org.... | fim | xkcoding/spring-boot-demo | java |
<|fim_prefix|>package com.xkcoding.cache.redis.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* <p>
* 用户实体
* </p>
*
* @author yangkai.shen
* @date Created in 2018-11-15 16:39
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public... | fim | xkcoding/spring-boot-demo | java |
<|fim_suffix|>ong id);
/**
* 删除
*
* @param id key值
*/
void delete(Long id);
}
<|fim_prefix|>package com.xkcoding.cache.redis.service;
import com.xkcoding.cache.redis.entity.User;
/**
* <p>
* UserService
* </p>
*
* @author yangkai.shen
* @date Created in 2018-11-15 16:45
*/
public i... | fim | xkcoding/spring-boot-demo | java |
<|fim_suffix|> DATABASES.remove(id);
log.info("删除用户【id】= {}", id);
}
}
<|fim_prefix|>package com.xkcoding.cache.redis.service.impl;
import com.google.common.collect.Maps;
import com.xkcoding.cache.redis.entity.User;
import com.xkcoding.cache.redis.service.UserService;
import lombok.extern.slf4j.Slf4j;
im... | fim | xkcoding/spring-boot-demo | java |
package com.xkcoding.cache.redis;
import com.xkcoding.cache.redis.entity.User;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate... | fim | xkcoding/spring-boot-demo | java |
<|fim_prefix|>package com.xkcoding.cache.redis;
import org.junit.Test;
import org<|fim_suffix|>ontextLoads() {
}
}
<|fim_middle|>.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBoo... | fim | xkcoding/spring-boot-demo | java |
package com.xkcoding.cache.redis.service;
import com.xkcoding.cache.redis.SpringBootDemoCacheRedisApplicationTests;
import com.xkcoding.cache.redis.entity.User;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
/**
* <p>
* Redis - 缓存测试
* </p>
*... | fim | xkcoding/spring-boot-demo | java |
<|fim_prefix|>package com.xkcoding.codegen;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* <p>
* 启动器
* </p>
*
* @author yangkai.shen
* @date Created in 2019-03-22 09:10
*/
@SpringBootApplication
public class SpringBootDemoCodegenApp... | fim | xkcoding/spring-boot-demo | java |
<|fim_prefix|>package com.xkcoding.codegen.common;
/**
* <p>
* 统一状态码接口
* </p>
*
* @author yangkai.shen
* @date Created in 2019-03-21 16:28
*/
public interface IResultCode {
/**
* 获取状态码
*
* @return 状态码
*/
Integer getCode();
<|fim_suffix|> */
String getMessage();
}
<|fim_middle... | fim | xkcoding/spring-boot-demo | java |
<|fim_prefix|>package<|fim_suffix|>ng total;
/**
* 页码
*/
private int pageNumber;
/**
* 每页结果数
*/
private int pageSize;
/**
* 结果集
*/
private List<T> list;
}
<|fim_middle|> com.xkcoding.codegen.common;
import lombok.AllArgsConstructor;
import lombok.Data;
import j... | fim | xkcoding/spring-boot-demo | java |
<|fim_suffix|> * 状态
*/
private boolean status;
/**
* 返回数据
*/
private T data;
public R(Integer code, String message, boolean status, T data) {
this.code = code;
this.message = message;
this.status = status;
this.data = data;
}
public R(IResult... | fim | xkcoding/spring-boot-demo | java |
<|fim_prefix|>package com.xkcoding.codegen.common;
import lombok.Getter;
/**
* <p>
* 通<|fim_suffix|>num ResultCode implements IResultCode {
/**
* 成功
*/
OK(200, "成功"),
/**
* 失败
*/
ERROR(500, "失败");
/**
* 返回码
*/
private Integer code;
/**
* 返回消息
*/
... | fim | xkcoding/spring-boot-demo | java |
<|fim_prefix|>package com.xkcoding.codegen.const<|fim_suffix|>Constants {
/**
* 签名
*/
String SIGNATURE = "xkcoding代码生成";
}
<|fim_middle|>ants;
/**
* <p>
* 常量池
* </p>
*
* @author yangkai.shen
* @date Created in 2019-03-22 10:04
*/
public interface Gen<|endoftext|> | fim | xkcoding/spring-boot-demo | java |
<|fim_suffix|>@RestController
@AllArgsConstructor
@RequestMapping("/generator")
public class CodeGenController {
private final CodeGenService codeGenService;
/**
* 列表
*
* @param request 参数集
* @return 数据库表
*/
@GetMapping("/table")
public R listTables(TableRequest request) {
... | fim | xkcoding/spring-boot-demo | java |
<|fim_prefix|>package com.xkcoding.codegen.entity;
import lombok.Data;
/**
* <p>
* 列属性: https://blog.csdn.net/lkforce/article/details/79557482
* </p>
*
* @author yangkai.shen
* @date Created in 2019-03-22 09:46
*/
@Data
public class ColumnEntity {
/**
* 列表
*/
private String columnName;
/*... | fim | xkcoding/spring-boot-demo | java |
package com.xkcoding.codegen.entity;
import lombok.Data;
/**
* <p>
* 生成配置
* </p>
*
* @author yangkai.shen
* @date Created in 2019-03-22 09:47
*/
@Data
public class GenConfig {
/**
* 请求参数
*/
private TableRequest request;
/**
* 包名
*/
private String packageName;
/**
* ... | fim | xkcoding/spring-boot-demo | java |
<|fim_suffix|>称
*/
private String tableName;
/**
* 备注
*/
private String comments;
/**
* 主键
*/
private ColumnEntity pk;
/**
* 列名
*/
private List<ColumnEntity> columns;
/**
* 驼峰类型
*/
private String caseClassName;
/**
* 普通类型
*/
... | fim | xkcoding/spring-boot-demo | java |
<|fim_suffix|>
<|fim_prefix|>package com.xkcoding.codegen.entity;
im<|fim_middle|>port lombok.Data;
/**
* <p>
* 表格请求参数
* </p>
*
* @author yangkai.shen
* @date Created in 2019-03-22 10:24
*/
@Data
public class TableRequest {
/**
* 当前页
*/
private Integer currentPage;
/**
* 每页条数
*/... | fim | xkcoding/spring-boot-demo | java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.